Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
- Added a comment line to main.ts for deployment verification purposes
87 lines
2.6 KiB
Plaintext
87 lines
2.6 KiB
Plaintext
server {
|
|
server_name sase.tr;
|
|
|
|
# Security headers
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
|
|
# Block sensitive paths
|
|
location ~ /\.(git|env) {
|
|
deny all;
|
|
return 404;
|
|
}
|
|
location ~ ^/(node_modules)/ {
|
|
deny all;
|
|
return 404;
|
|
}
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
|
|
|
root /home/s/ss/apps/web/dist;
|
|
index index.html;
|
|
|
|
# Faro telemetry proxy → Grafana Cloud (avoids CORS)
|
|
location /collect/ {
|
|
resolver 1.1.1.1 8.8.8.8 valid=300s ipv6=off;
|
|
set $faro_upstream "faro-collector-prod-eu-west-2.grafana.net";
|
|
proxy_pass https://$faro_upstream/collect/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $faro_upstream;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
# Proxy API requests to NestJS backend
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:4000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
# Static assets with long cache
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# SPA fallback — all routes resolve to index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
listen 443 ssl;
|
|
ssl_certificate /etc/letsencrypt/live/sase.tr/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/sase.tr/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
}
|
|
server {
|
|
if ($host = sase.tr) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
|
|
listen 80;
|
|
server_name sase.tr;
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
|
}
|