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.
54 lines
1.7 KiB
54 lines
1.7 KiB
server {
|
|
listen 80;
|
|
server_name pipboy; # Замените на ваш домен
|
|
root /var/www/html; # Путь к Angular приложению
|
|
index index.html;
|
|
|
|
# Отдача статических файлов
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /mesh/ws {
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_http_version 1.1;
|
|
proxy_pass http://127.0.0.1:8868;
|
|
}
|
|
|
|
location /mesh/api/ {
|
|
proxy_pass http://127.0.0.1:8868;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
# Кэширование статических ресурсов
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2|ttf)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Запрет доступа к скрытым файлам
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
# Оптимизация для больших файлов
|
|
client_max_body_size 100m;
|
|
|
|
# Безопасность
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
# Gzip сжатие
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
|
|
}
|