1
0
Fork 0
forked from OpenNeo/impress

Add more headers to nginx proxy_pass

Mm, something in Rails was getting upset when working with session cookies because the `Host` header was `127.0.0.1:3000` instead of `beta.impress.openneo.net`. I only saw this log entry on important actions like login, so my hope is that this is why login is failing??

I was intentionally omitting these to start, because I didn't understand them well and didn't want to add things I didn't understand. But now I've checked in on them more and they seem standard and reasonable. Ok!

```
HTTP Origin header (https://beta.impress.openneo.net) didn't match request.base_url (http://127.0.0.1:3000)
```

Source: https://stackoverflow.com/a/73198861/107415
This commit is contained in:
Emi Matchu 2023-08-20 14:35:18 -07:00
parent 9b68e982e7
commit 65387952ac

View file

@ -323,6 +323,12 @@
location @app { location @app {
proxy_pass http://127.0.0.1:3000; proxy_pass http://127.0.0.1:3000;
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-Server $host;
proxy_set_header Host $http_host;
proxy_redirect off;
} }
} }
dest: /etc/nginx/sites-available/impress.conf dest: /etc/nginx/sites-available/impress.conf