4chan/conf/site/sys.4chan.org.nginx.inc
2025-04-17 18:12:08 -05:00

124 lines
4.7 KiB
PHP

# Autogenerated by /www/global/bin/confgen 2009-12-18
# but don't run confgen again, this has local changes now
server_name sys.4chan.org sys.4channel.org;
#access_log off;
access_log /www/logs/sys_access_log combined buffer=32k;
#error_log /dev/null;
error_log /www/logs/sys_error_log error;
#rewrite_log on;
root /www/4chan.org/web/sys;
sendfile on;
aio on;
# internal requests should avoid authentication
location /j/ { index imgboard.html.php;
#auth_basic "Team 4chan";
#auth_basic_user_file /www/global/htpasswd/janitors_nginx;
}
#location /test/ { auth_basic "Team 4chan"; auth_basic_user_file /www/global/htpasswd/developers_nginx; }
location /test/xhprof/ { index index.php; auth_basic "Team 4chan"; auth_basic_user_file /www/global/htpasswd/developers_nginx; }
location /apc.php {
deny all;
}
# no auth here
location = /j/1mcQTXbjW5WO.php {
fastcgi_pass unix:/tmp/phpfpm-admin.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* ^/j/.*\.php$ {
auth_basic "Team 4chan"; auth_basic_user_file /www/global/htpasswd/janitors_nginx;
#fastcgi_pass localhost:9002;
fastcgi_pass unix:/tmp/phpfpm-admin.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* ^/test/.*\.php$ {
auth_basic "Team 4chan"; auth_basic_user_file /www/global/htpasswd/developers_nginx;
#fastcgi_pass localhost:9002;
fastcgi_pass unix:/tmp/phpfpm-admin.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* (admin)\.php$ {
#fastcgi_pass localhost:9002;
auth_basic "Team 4chan"; auth_basic_user_file /www/global/htpasswd/janitors_nginx;
fastcgi_pass unix:/tmp/phpfpm-admin.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
#add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* (auth)\.php$ {
#fastcgi_pass localhost:9002;
fastcgi_pass unix:/tmp/phpfpm-admin.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* imgboard_slow\.php$ {
#fastcgi_pass localhost:9003;
fastcgi_pass unix:/tmp/phpfpm-imgboard_slowjail.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
include nginx_cors_sys.conf;
}
location ~* imgboard_rebuildd\.php$ {
#fastcgi_pass localhost:9003;
fastcgi_pass unix:/tmp/phpfpm-imgboard_rebuildd.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
include nginx_cors_sys.conf;
}
location ~* (rid|banned|derefer)\.php$ {
#fastcgi_pass localhost:9004;
fastcgi_pass unix:/tmp/phpfpm-rid.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
add_header X-Frame-Options "DENY";
include nginx_cors_sys.conf;
}
location ~* \.php$ {
#fastcgi_pass localhost:9001;
fastcgi_pass unix:/tmp/phpfpm-sys.sock;
include /www/conf/fastcgi_params;
add_header Strict-Transport-Security "max-age=15768000";
include nginx_cors_sys.conf;
}
rewrite ^/j/(res/|thread/)([0-9]+)$ /j/thread/$2.html.php;
rewrite ^/j/([0-9]+)$ /j/$1.html.php;
rewrite ^/test/post /test/imgboard.php break;
rewrite ^/test/admin /test/admin.php break;
rewrite (^/test/.*\.php$) $1 break;
rewrite ^/(pol)/post$ /$1/imgboard_slow.php;
rewrite ^/(a|b|v[g]?)/post$ /$1/imgboard_rebuildd.php;
rewrite ^/([a-z0-9]+)/post$ /$1/imgboard.php;
rewrite ^/auth$ /auth.php;
rewrite ^/banned$ /banned.php;
rewrite ^/derefer$ /derefer.php;
rewrite ^/captcha$ /captcha.php;
rewrite ^/signin$ /signin.php;
rewrite ^/([a-z0-9]+)/(imgboard(_rebuildd|_slow)?|admin)(\.php)?$ /$2.php;
include /www/conf/nginx_site_global.conf;