Passthrough X-Forwarded-Proto header in frontend nginx (#1226)

If X-Forwarded-Proto header is already set, pass that through instead of setting to current scheme.
This commit is contained in:
Vinzenz Sinapius 2023-09-28 19:58:57 +02:00 committed by GitHub
parent 7a56fa23f5
commit 9b125bc2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,12 @@ server {
}
}
# if behind proxy passthrough X-Forwarded-Proto header
map $http_x_forwarded_proto $ingress_proto {
"" $scheme;
default $http_x_forwarded_proto;
}
server {
listen 80 default_server;
@ -51,7 +57,7 @@ server {
location /api/ {
proxy_pass http://${BACKEND_HOST}:8000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $ingress_proto;
}
location ~* /watch/([^/]+)/([^/]+)/([^/]+)/ws {
@ -125,4 +131,3 @@ server {
include ./includes/*.conf;
}