-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ProxyFix should use X-Forwarded-Port #1023
Comments
FYI, X- means experimental and the feature is a standard now rfc7239 |
Yeah we should probably support the Forwarded header as well, though I have only seen the ad-hoc standard in practice. |
(Also X practically means "nonstandard", not "experimental") |
Normally, sites are served in default ports (80 for HTTP, 443 for HTTPS) so AWS ELB/ALB set |
I just finished chasing a very annoying issue with application's redirects breaking because the external port was not being picked up by ProxyFix. |
@c4milo This issue is already closed. |
For some reason it does not appear to work for me. Consider this test script:
nginx is set up approriately. When I access the URL, I don't get redirected to the right port:
This is the output of the test script:
Am I doing something wrong? |
All |
Not sure if we are talking about the same problem. I'd expect the output of the curl command above to be |
You didn't specify |
Reporting this against Werkzeug, ignore the fact that I keep saying Flask. ;-)
If the app is behind a proxy and the proxy is listening on a non-standard port (ex. 8080), Flask will not generate valid urls unless
SERVER_PORT
is changed orHTTP_HOST
includes the port.ProxyFix
should setSERVER_PORT = X-Forwarded-Port
, or Flask's deploy docs should addproxy_set_header Host $host:$server_port;
. Not really sure which one is correct, I've seen both mentioned.The text was updated successfully, but these errors were encountered: