Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $remote_scheme to correctly set the HTTP protocol the client is used #156

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

rooftopcellist
Copy link
Member

Resolves: #155

This PR modifies the nginx configmap to use $remote_scheme to correctly set the HTTP protocol the client is used.

cc @kurokobo

Copy link
Contributor

@Alex-Izquierdo Alex-Izquierdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This map is intended to use $remote_scheme instead of $scheme, don't?

@kurokobo
Copy link
Contributor

Thanks for working on this too!
@Alex-Izquierdo is correct, these are suggested changes:

             location ~ ^/api/eda/v[0-9]+/ {
                 proxy_pass http://{{ ansible_operator_meta.name }}-api:8000;
                 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;
             }
             location / {
                 # Redirect all traffic from root to /eda/
-                return 301 $scheme://$host/eda/;
+                return 301 $remote_scheme://$host/eda/;
             }

…sing

Signed-off-by: Christian M. Adams <chadams@redhat.com>
@rooftopcellist
Copy link
Member Author

Thanks to both of you! I made those changes and tested this out and I can still access the UI at eda/, and it redirects properly. Thanks!

@rooftopcellist rooftopcellist merged commit 0e00851 into ansible:main Dec 15, 2023
@Alex-Izquierdo
Copy link
Contributor

@jamesmarshall24 I think this is a nice enhancement to bring up also in the installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessing / over HTTPS redirects to eda/ over HTTP
3 participants