siepatchwiki/nginx/default.conf
2025-03-31 07:50:42 -05:00

66 lines
1.9 KiB
Text

server {
listen 80;
server_name _;
root /app;
index index.php;
charset utf-8;
error_log /dev/stdout info;
#Cloudflare support
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
client_max_body_size 100m;
error_page 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
try_files $uri $uri/ =404;
}
location /images {
try_files $uri =404;
add_header X-Content-Type-Options nosniff;
}
location /img {
alias /img/;
try_files $uri =404;
add_header X-Content-Type-Options nosniff;
}
location ~ /vendor/ { deny all; }
location ~ /cache/ { deny all; }
location ~ /tests/ { deny all; }
location ~ /maintenance/ { deny all; }
location ~ /languages/ { deny all; }
location ~ /includes/ { deny all; }
location ~ /mw-config/ { deny all; }
location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /app/$fastcgi_script_name;
include fastcgi_params;
client_max_body_size 100M;
}
}