lct-hack/frontend/nginx.conf.template

38 lines
1 KiB
Text
Raw Normal View History

server {
listen 5173;
server_name _;
root /usr/share/nginx/html;
gzip on;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_types application/javascript application/json image/svg+xml text/css text/plain;
location /api/ {
proxy_pass http://${BACKEND_HOST}:${BACKEND_PORT};
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /ws/ {
proxy_pass http://${BACKEND_HOST}:${BACKEND_PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 75s;
}
location ~* \.(?:css|js|woff2?|png|svg)$ {
try_files $uri =404;
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache";
}
}