i hate nginx

This commit is contained in:
2025-06-01 03:34:22 +02:00
parent db0fe61673
commit d8b4bc33da
2 changed files with 36 additions and 9 deletions

View File

@@ -1,11 +1,26 @@
server {
listen 8097;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
# Enable gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Cache static assets
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}