2024-03-29 20:08:34 -04:00
|
|
|
upstream frontend {
|
|
|
|
|
server frontend:5173;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
upstream backend {
|
|
|
|
|
server backend:3000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
2025-02-11 19:19:49 -05:00
|
|
|
|
|
|
|
|
#FOR PROD
|
|
|
|
|
#listen 443 ssl; # Listen for SSL at port 443 as well
|
2024-03-29 20:08:34 -04:00
|
|
|
|
|
|
|
|
location /api {
|
|
|
|
|
rewrite /backend/(.*) /$1 break;
|
|
|
|
|
proxy_pass http://backend;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-05 16:40:40 -04:00
|
|
|
location /socket.io {
|
|
|
|
|
rewrite /backend/(.*) /$1 break;
|
|
|
|
|
proxy_pass http://backend;
|
2024-04-05 20:10:59 -04:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_hide_header 'Access-Control-Allow-Origin';
|
2024-04-05 16:40:40 -04:00
|
|
|
}
|
|
|
|
|
|
2024-03-29 20:08:34 -04:00
|
|
|
location / {
|
|
|
|
|
proxy_pass http://frontend;
|
|
|
|
|
}
|
2025-02-11 19:19:49 -05:00
|
|
|
|
|
|
|
|
#FOR PROD
|
|
|
|
|
# If a user tries to come through http, redirect them through https
|
|
|
|
|
#if ($scheme != "https") {
|
|
|
|
|
# return 301 https://$host$request_uri;
|
|
|
|
|
#}
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-04-05 16:40:40 -04:00
|
|
|
}
|