Skip to content
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

proxying request.scheme with nginx #872

Closed
imbolc opened this issue May 10, 2016 · 4 comments
Closed

proxying request.scheme with nginx #872

imbolc opened this issue May 10, 2016 · 4 comments
Labels

Comments

@imbolc
Copy link
Contributor

imbolc commented May 10, 2016

aiohttp server is working over https behind nginx and it has proxy_set_header X-Forwarded-Proto $scheme; setting in nginx config, but request.scheme anyway equals 'http'

@popravich popravich added question StackOverflow web labels May 16, 2016
@popravich
Copy link
Member

popravich commented May 16, 2016

You must provide secure_proxy_ssl_header keyword parameter in app.make_handler
(see doc1, doc2):

app.make_handler(secure_proxy_ssl_header='X-Forwarded-Proto')

@imbolc
Copy link
Contributor Author

imbolc commented May 16, 2016

Thank you, it's working:

app.make_handler(secure_proxy_ssl_header=('X-Forwarded-Proto', 'https'))

@popravich
Copy link
Member

yeah, it must be tuple of header and expected value)

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants