forked from refracta/dcss-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
46 lines (39 loc) · 1.35 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
server {
listen 8082;
root /var/www/crawl;
index index.html index.htm;
# Enable gzip for specific file types
gzip on;
gzip_types application/javascript text/css;
# CGI-bin configuration
location /cgi-bin/ {
root /usr/lib;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
gzip off;
fastcgi_buffering off;
}
# General settings for the root location
location / {
charset utf-8;
fancyindex on;
fancyindex_exact_size off;
fancyindex_localtime on;
default_type text/plain;
sub_filter '</body>' '<script src="https://cdn.jsdelivr.net/gh/refracta/dcss-archive-scripts/script.js"></script></body>';
# Rewrite rules for /ttyrec files
location /ttyrec/ {
if (!-f $request_filename) {
# rewrite ^/ttyrec/([^/]*)/(.*\.ttyrec)$ /ttyrec/$1/$2.bz2 break;
}
}
}
# Rewrite rules for saves and rebuild
rewrite ^/saves/(.*)$ /cgi-bin/auth-save-downloader.pl?file=$1 break;
rewrite ^/rebuild(/(.*))?$ /cgi-bin/trigger-rebuild.pl?v=$2 break;
# Turn off compression for /rebuild to see compile messages in real time
location /rebuild/ {
set $no_gzip 1;
rewrite ^/rebuild(/(.*))?$ /cgi-bin/trigger-rebuild.pl?v=$2 break;
}
}