aboutsummaryrefslogtreecommitdiff
path: root/up.chud.cyou
diff options
context:
space:
mode:
Diffstat (limited to 'up.chud.cyou')
-rw-r--r--up.chud.cyou45
1 files changed, 45 insertions, 0 deletions
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;
+}