diff --git a/transportmanager/deploy/nginx.conf b/transportmanager/deploy/nginx.conf index 9d76671..a576b8f 100644 --- a/transportmanager/deploy/nginx.conf +++ b/transportmanager/deploy/nginx.conf @@ -9,6 +9,11 @@ http { access_log /dev/stdout main; error_log /dev/stderr warn; + map $http_x_forwarded_proto $x_proto_pass { + default $http_x_forwarded_proto; + '' $scheme; + } + # Upstreams (internal) upstream api_upstream { server 127.0.0.1:5000; } upstream flet_upstream { server 127.0.0.1:8080; } @@ -21,7 +26,8 @@ http { location /api/ { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Proto $x_proto_pass; + proxy_set_header X-Forwarded-Host $host; proxy_pass http://api_upstream/; } @@ -29,7 +35,8 @@ http { location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Proto $x_proto_pass; + proxy_set_header X-Forwarded-Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;