Skip to content

Commit

Permalink
Merge pull request #156 from rooftopcellist/remote-scheme-redirect
Browse files Browse the repository at this point in the history
Use $remote_scheme to correctly set the HTTP protocol the client is used
  • Loading branch information
rooftopcellist committed Dec 15, 2023
2 parents db800aa + b430e9b commit 0e00851
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions roles/eda/templates/eda.configmap.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ data:
worker_connections 1024;
}
http {
map $http_x_forwarded_proto $remote_scheme {
default $http_x_forwarded_proto;
'' $scheme;
}

include mime.types;
types {
application/manifest+json webmanifest;
Expand Down Expand Up @@ -75,7 +80,7 @@ data:
proxy_set_header Origin http://{{ ansible_operator_meta.name }}-api:8000;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $remote_scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -88,7 +93,7 @@ data:

location / {
# Redirect all traffic from root to /eda/
return 301 $scheme://$host/eda/;
return 301 $remote_scheme://$host/eda/;
}

location /eda/ {
Expand Down

0 comments on commit 0e00851

Please sign in to comment.