lingthio / Flask-User

Customizable User Authorization & User Management: Register, Confirm, Login, Change username/password, Forgot password and more.
http://flask-user.readthedocs.io/
MIT License
1.06k stars 292 forks source link

Login redirect behind proxy returns 404 #275

Closed johschmitz closed 5 years ago

johschmitz commented 5 years ago

I am trying to use flask-user in a Heroku App behind a chisel proxy. When opening the website it redirects me to localhost:<port>/user/sign-in?next=/ instead of <app-url>/user/sign-in?next=/. I tried to set flask's app.config['SERVER_NAME'] to the correct URL but then I get a 404 Not Found error. I guess this is because gunicorn only talks to the proxy so it thinks that the SERVER_NAME must be 127.0.0.1: or something like that. What would be the correct way of configuring flask-user for this scenario?

johschmitz commented 5 years ago

I solved this by using nginx as the proxy and then gunicorn and chisel behind that. The Chisel proxy is too simple and apparently is not able to provide the correct HTTP headers to make this work.