mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
80 lines
2.4 KiB
Nginx Configuration File
80 lines
2.4 KiB
Nginx Configuration File
server {
|
||
listen 80;
|
||
server_name itformhelp.ru;
|
||
|
||
# Редирект с HTTP на HTTPS
|
||
location / {
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
|
||
# Для валидации Let's Encrypt
|
||
location /.well-known/acme-challenge/ {
|
||
root /var/www/certbot;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name itformhelp.ru;
|
||
|
||
# SSL сертификаты
|
||
ssl_certificate /etc/letsencrypt/live/itformhelp.ru/fullchain.pem;
|
||
ssl_certificate_key /etc/letsencrypt/live/itformhelp.ru/privkey.pem;
|
||
|
||
# Оптимизация SSL
|
||
ssl_session_cache shared:SSL:10m;
|
||
ssl_session_timeout 10m;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_prefer_server_ciphers off;
|
||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||
|
||
root /usr/share/nginx/html;
|
||
index index.html;
|
||
|
||
# Gzip Settings
|
||
gzip on;
|
||
gzip_vary on;
|
||
gzip_min_length 10240;
|
||
gzip_proxied expired no-cache no-store private auth;
|
||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
|
||
gzip_disable "MSIE [1-6]\.";
|
||
|
||
# API proxy
|
||
location /api/ {
|
||
proxy_pass http://support-backend:8000;
|
||
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;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
}
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||
}
|
||
|
||
# Запрещаем доступ к .htaccess файлам
|
||
location ~ /\.ht {
|
||
deny all;
|
||
}
|
||
|
||
# Запрещаем доступ к файлам WordPress
|
||
location ~* \.(xml|txt)$ {
|
||
return 404;
|
||
}
|
||
|
||
# Запрещаем доступ к директориям WordPress
|
||
location ~* ^/(wp-admin|wp-includes|wp-content|wordpress|wp|blog|news|cms)/ {
|
||
return 404;
|
||
}
|
||
|
||
error_page 404 /index.html;
|
||
error_page 500 502 503 504 /50x.html;
|
||
location = /50x.html {
|
||
root /usr/share/nginx/html;
|
||
}
|
||
} |