Use a map for passing x-forwarded-proto along

master
kaiyou 7 years ago
parent 42314d3d75
commit 2dfc91ac4d

@ -20,6 +20,12 @@ http {
absolute_redirect off;
resolver {{ RESOLVER }} valid=30s;
# Header maps
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# Main HTTP server
server {
# Variables for proxifying

@ -2,4 +2,4 @@
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;

Loading…
Cancel
Save