123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
server {
listen 5012;
server_name 5q12-indexer;
root {WEB_PATH};
index index.php;
location /internal-files/ {
internal;
alias {WEB_PATH}/files/;
sendfile on;
sendfile_max_chunk 1m;
tcp_nopush on;
tcp_nodelay on;
add_header Accept-Ranges bytes;
expires off;
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
}
location ~ ^/\.indexer_files/local_api/style/.*\.(css|woff2)$ {
location ~* \.css$ {
add_header Content-Type "text/css" always;
}
location ~* \.woff2$ {
add_header Content-Type "font/woff2" always;
}
expires 1d;
add_header Cache-Control "public, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}
location ~ ^/\.indexer_files/icons/.*\.png$ {
add_header Content-Type "image/png" always;
expires 7d;
add_header Cache-Control "public, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}
location ~ ^/\.indexer_files/favicon/.*\.(ico|png)$ {
location ~* \.ico$ {
add_header Content-Type "image/x-icon" always;
}
location ~* \.png$ {
add_header Content-Type "image/png" always;
}
expires 7d;
add_header Cache-Control "public, immutable" always;
add_header X-Content-Type-Options "nosniff" always;
try_files $uri =404;
}
location ~ ^/\.indexer_files/(?!local_api/style/|icons/|favicon/) {
deny all;
return 404;
}
location / {
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
if ($uri != "/index.php") {
return 404;
}
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 7200;
fastcgi_send_timeout 7200;
fastcgi_buffering off;
fastcgi_request_buffering off;
set $is_download 0;
if ($arg_download) {
set $is_download 1;
}
}
location ~ /\.(ht|git|env|log|sqlite|json)$ {
deny all;
return 404;
}
location ~ \.(bak|backup|old|tmp|temp|swp|swo|~)$ {
deny all;
return 404;
}
location ~ ^/(config|configuration|settings|private|admin|api|\.well-known) {
deny all;
return 404;
}
location ~ /(wp-|wordpress|admin|phpmyadmin|mysql|database) {
deny all;
return 404;
}
client_max_body_size 200G;
client_body_buffer_size 128k;
client_header_buffer_size 4k;
large_client_header_buffers 8 8k;
}