3 changed files with 69 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||||
|
server { |
||||
|
listen 80; |
||||
|
server_name pipboy; # Замените на ваш домен |
||||
|
root /home/pipboy/Pipboy3Kmark4/pipboyUI/dist/pipboy-ui; # Путь к Angular приложению |
||||
|
index index.html; |
||||
|
|
||||
|
# Отдача статических файлов |
||||
|
location / { |
||||
|
try_files $uri $uri/ /index.html; |
||||
|
} |
||||
|
|
||||
|
# Кэширование статических ресурсов |
||||
|
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; |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
sudo apt install nginx |
||||
|
sudo systemctl stop nginx |
||||
|
sudo rm /etc/nginx/sites-available/default |
||||
|
sudo ln -s ~/Pipboy3Kmark4/pipboyWEB/nginx.conf /etc/nginx/sites-available/pipboy |
||||
|
sudo nginx -t |
||||
|
sudo systemctl start nginx |
||||
Loading…
Reference in new issue