Skip to content

Issue when using "add" with X-Forwarded-Proto header #2529

Answered by kate-osborn
utopiandreams asked this question in Q&A
Discussion options

You must be logged in to vote

@utopiandreams we recently added the X-Forwarded-Proto: $scheme header to the base nginx configuration: https://github.com/nginxinc/nginx-gateway-fabric/blob/1241d101314b535192b89e1114965c0a52064388/internal/mode/static/nginx/config/servers.go#L49.

So we now add the following headers by default to all location blocks:

      proxy_set_header Host "$gw_api_compliant_host";
      proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";
      proxy_set_header Upgrade "$http_upgrade";
      proxy_set_header Connection "$connection_upgrade";
      proxy_set_header X-Real-IP "$remote_addr";
      proxy_set_header X-Forwarded-Proto "$scheme";
      proxy_set_header X-Forwarded-Host "$host";…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@utopiandreams
Comment options

Answer selected by kate-osborn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants