Skip to content

Commit

Permalink
Set X-Forwarded-Proto to request scheme (mastodon#15310) (mastodon#15498
Browse files Browse the repository at this point in the history
)

This fixes a bug that prevents logins to mastodon onion services. The
nginx directive assumed all requests were made over https, causing a
domain mismatch for onion services that have https redirects disabled.
The fix more correctly sets X-Forwarded-Proto to the actual scheme used
in the request.
  • Loading branch information
cohosh authored Jan 5, 2021
1 parent 15be570 commit 38bc4b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ server {
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 https;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Proxy "";
proxy_pass_header Server;

Expand All @@ -98,7 +98,7 @@ server {
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 https;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Proxy "";

proxy_pass http://streaming;
Expand Down

0 comments on commit 38bc4b9

Please sign in to comment.