-
Notifications
You must be signed in to change notification settings - Fork 28
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
Reverse Proxy Headers #77
Comments
You can set http request header in location: proxy_set_headers = [
"X-Forwarded-For:$proxy_add_x_forwarded_for",
"X-Real-IP:$remote_addr",
] |
@vicanso It still would be nice to have this as an option to toggle these headers on the upstream level instead of having to manually add them for every new location added. Even a toggle would be nice in the location options, but upstream seems the most ideal place for ease of use and effiency. |
The next version considers adding this configuration in location. |
@NebulaMods You can add this to location config, enable_reverse_proxy_headers = true which will add these header to location's upstream proxy request: "X-Real-IP:$remote_addr".to_string(),
"X-Forwarded-For:$proxy_add_x_forwarded_for".to_string(),
"X-Forwarded-Proto:$scheme".to_string(),
"X-Forwarded-Host:$host".to_string(),
"X-Forwarded-Port:$server_port".to_string(), |
An option to enable in the upstream so it will automatically include the "X-Forwarded-For" header, and other headers etc.
The text was updated successfully, but these errors were encountered: