You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

server {
listen 80;
server_name localhost;
root /app/.output/public;
index index.html;
# Proper MIME type handling
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Security headers
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
location / {
try_files $uri $uri/ /index.html;
}
# Handle static files
location /_nuxt/ {
alias /app/.output/public/_nuxt/;
expires 1y;
add_header Cache-Control "public, no-transform";
try_files $uri =404;
}
# Handle other static files
location /public/ {
alias /app/public/;
expires 1y;
add_header Cache-Control "public, no-transform";
try_files $uri =404;
}
# Handle API requests
location /api/ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}