change nginx.conf
This commit is contained in:
@@ -18,6 +18,7 @@ server {
|
||||
listen 443 ssl http2;
|
||||
server_name www.ntspi.ru;
|
||||
|
||||
# SSL-конфигурация
|
||||
ssl_certificate /etc/letsencrypt/live/www.ntspi.ru/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/www.ntspi.ru/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/www.ntspi.ru/chain.pem;
|
||||
@@ -32,6 +33,7 @@ server {
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
|
||||
# Сжатие
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||
@@ -46,36 +48,36 @@ server {
|
||||
|
||||
root /var/www/public;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-Content-Type-Options "nosniff";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
|
||||
|
||||
location ~ ^/(upload|storage|images|docs|files)/.*\.php$ {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ ^/storage/app/public/upload/iblock/.*\.php$ {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ ^/vendor/.*\.php$ {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Основной вход в приложение
|
||||
location / {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
try_files $uri /index.php?$args;
|
||||
}
|
||||
|
||||
# =========================================================================
|
||||
# Настройки для VIKON CORE (Исправление ошибки 404)
|
||||
# =========================================================================
|
||||
location ^~ /vikon_core/ {
|
||||
root /var/www/public;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass app:9000;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param HTTPS On;
|
||||
}
|
||||
}
|
||||
|
||||
# Статические разделы SVEDEN и ABITUR
|
||||
location /sveden/ {
|
||||
alias /var/www/public/sveden/;
|
||||
index index.html;
|
||||
@@ -100,6 +102,7 @@ server {
|
||||
return 301 /abitur/;
|
||||
}
|
||||
|
||||
# Общий обработчик PHP для остального сайта
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
@@ -114,6 +117,12 @@ server {
|
||||
fastcgi_param HTTPS On;
|
||||
}
|
||||
|
||||
# Запрет доступа к скрытым файлам
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Блок для обновления Let's Encrypt
|
||||
location ^~ /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
allow all;
|
||||
|
||||
Reference in New Issue
Block a user