@@ -28,12 +28,21 @@ server {
2828 # The most important location block, by default all requests are sent to gunicorn
2929 # If you serve galaxy at a path like /galaxy, change that below (and all other locations!)
3030 location / {
31- # This is the backend to send the requests to.
32- proxy_pass http://galaxy;
31+ # Remove any forwarded headers that clients might have sent
32+ proxy_set_header X-Forwarded-For "";
33+ proxy_set_header X-Forwarded-Proto "";
34+ proxy_set_header X-Forwarded-Host "";
35+
36+ # Set the headers with trusted values
3337 proxy_set_header Host $http_host;
34- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
38+ proxy_set_header X-Forwarded-For $remote_addr ;
3539 proxy_set_header X-Forwarded-Proto $scheme;
40+ proxy_set_header X-Forwarded-Host $host;
3641 proxy_set_header Upgrade $http_upgrade;
42+ proxy_set_header Connection "upgrade";
43+
44+ # This is the backend to send the requests to
45+ proxy_pass http://galaxy;
3746 }
3847
3948 location /api/upload/resumable_upload {
@@ -99,7 +108,7 @@ server {
99108 proxy_buffering off;
100109 proxy_set_header Host $http_host;
101110 proxy_set_header X-Real-IP $remote_addr;
102- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
111+ proxy_set_header X-Forwarded-For $remote_addr ;
103112 proxy_set_header X-Forwarded-Proto $scheme;
104113 }
105114
0 commit comments