From a9c95145e8b3d9a46a4597e4c4c5d4ac77ad18db Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sun, 6 Jul 2025 18:36:26 +0000 Subject: nginx, in deployment --- up.chud.cyou | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 up.chud.cyou (limited to 'up.chud.cyou') diff --git a/up.chud.cyou b/up.chud.cyou new file mode 100644 index 0000000..6d8232b --- /dev/null +++ b/up.chud.cyou @@ -0,0 +1,45 @@ +map $http_user_agent $cli { + default 0; + ~*wget 1; + ~*curl 1; +} + +server { + server_name up.chud.cyou; + root /var/www/up.chud.cyou; + + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + + ssl_certificate ...; + ssl_certificate_key ...; + + error_page 404 https://up.chud.cyou/chud/404; + + location ~ /\.git { + deny all; + } + + client_max_body_size 100m; + + location ^~ /out/ { + autoindex on; + } + + location = /upchud.tcl { + # include authorized; + # deny all; + include fastcgi_params; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + fastcgi_param SCRIPT_FILENAME /var/www/up.chud.cyou/upchud.tcl; + } + + if ($cli) { + rewrite ^/.*$ /upchud.tcl last; + } + rewrite ^/$ /index.html last; + rewrite ^/upchud.tcl$ /upchud.tcl last; + rewrite ^/(.+)$ /out/$1; +} -- cgit v1.2.3