Add boilerplate nginx setup for prod self-hosting

This commit is contained in:
Tuan Dang
2022-11-18 18:12:27 -05:00
parent 688aa856ab
commit baa0a21b38
9 changed files with 148 additions and 92 deletions

32
nginx/default.dev.conf Normal file
View File

@@ -0,0 +1,32 @@
server {
listen 80;
location /api {
proxy_set_header X-Real-RIP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://backend:4000;
proxy_redirect off;
proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";
}
location / {
include /etc/nginx/mime.types;
proxy_set_header X-Real-RIP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://frontend:3000;
proxy_redirect off;
}
}