2026-01-08 04:00:41 +00:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Gzip compression
|
2026-01-08 04:00:41 +00:00
|
|
|
gzip on;
|
2026-01-08 15:49:32 +00:00
|
|
|
gzip_types text/plain text/css application/json application/javascript text/xml;
|
2026-01-08 04:00:41 +00:00
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Angular SPA routing
|
2026-01-08 04:00:41 +00:00
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# API proxy
|
2026-01-08 04:00:41 +00:00
|
|
|
location /graphql {
|
2026-01-08 15:49:32 +00:00
|
|
|
proxy_pass http://api:5000;
|
2026-01-08 04:00:41 +00:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
2026-01-08 15:49:32 +00:00
|
|
|
proxy_set_header Connection 'upgrade';
|
2026-01-08 04:00:41 +00:00
|
|
|
proxy_set_header Host $host;
|
2026-01-08 15:49:32 +00:00
|
|
|
proxy_cache_bypass $http_upgrade;
|
2026-01-08 04:00:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /health {
|
2026-01-08 15:49:32 +00:00
|
|
|
proxy_pass http://api:5000;
|
2026-01-08 04:00:41 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Cache static assets
|
|
|
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
2026-01-08 04:00:41 +00:00
|
|
|
expires 1y;
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
}
|
|
|
|
|
}
|