EvalueTonSavoir/nginx/default.conf

61 lines
1.5 KiB
Text
Raw Normal View History

2024-03-29 20:08:34 -04:00
upstream frontend {
server frontend:5173;
}
upstream backend {
server backend:3000;
}
server {
listen 80;
#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;
}
#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
2025-02-21 13:29:26 -05:00
#TEST DE CONFIG PROD
#server {
#listen 443 ssl http2;
#ssl_protocols TLSv1.2 TLSv1.3;
#ssl_prefer_server_ciphers on;
#ssl_ciphers ECDH+AESGCM:ECDH+AES256-CBC:ECDH+AES128-CBC:DH+3DES:!ADH:!AECDH:!MD5;
#ssl_certificate ...;
#ssl_certificate_key ...;
#ssl_dhparam /etc/nginx/certs/dhparam.pem;
#ssl_stapling on;
#ssl_stapling_verify on;
#ssl_trusted_certificate /etc/nginx/certs/lets-encrypt-x3-cross-signed.pem;
#ssl_session_cache shared:SSL:40m;
#ssl_session_timeout 4h;
#ssl_session_tickets on;
#add_header Strict-Transport-Security "max-age=31536000" always;
#}
2024-04-05 16:40:40 -04:00
}