update many things

This commit is contained in:
2026-05-04 20:02:10 +03:30
parent 797aecd489
commit ec452bca22
72 changed files with 1375 additions and 606 deletions
+19 -71
View File
@@ -1,80 +1,28 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
server {
listen 8090;
server_name _;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 20M;
root /usr/share/nginx/html;
index index.html;
# 🔥 Gzip
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml text/javascript
application/json application/javascript application/xml+rss
application/rss+xml font/truetype font/opentype
application/vnd.ms-fontobject image/svg+xml;
include /etc/nginx/conf.d/*.conf;
# 🔥 Brotli (better than gzip)
# brotli on;
# brotli_comp_level 6;
# brotli_types text/plain text/css application/javascript application/json image/svg+xml;
server {
listen 5000;
server_name localhost;
charset utf-8;
# 🔥 Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
root /usr/share/nginx/html;
index index.html index.htm;
# 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;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Cache control for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Service worker files should be revalidated on each request
location = /ngsw.json {
expires -1;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
location = /ngsw-worker.js {
expires -1;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Angular routing - serve index.html for all routes
location / {
try_files $uri $uri/ /index.html;
}
# Don't cache index.html
location = /index.html {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
}
# 🔥 Angular routing (SPA fallback)
location / {
try_files $uri $uri/ /index.html;
}
}