summaryrefslogtreecommitdiffstats
path: root/colophon/oddmuse/emacsconf.org.conf
blob: a1ada04de2f96816cbfe384f736c6b9a4b37c2d0 (plain) (blame)
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
47
48
server {
        listen 80;
        #listen [::]:80;

        server_name emacsconf.org www.emacsconf.org;
        return 302 https://$server_name$request_uri;
}

server {
        listen 443 ssl http2;
        #listen [::]:443 ssl;
        server_name www.emacsconf.org;
        include /etc/nginx/tls/emacsconf.org.conf;
        return 302 https://emacsconf.org$request_uri;
}

upstream omec {
        server 127.0.0.1:11937;
}

server {
        listen 443 ssl http2;
        #listen [::]:443 ssl;
        server_name emacsconf.org;

        include /etc/nginx/tls/emacsconf.org.conf;

        location / {
                if ($is_args = "") { rewrite ^(.*)/main$ /$1 redirect; }
                # if ($request_uri ~ "^/([\d]{4})/$") { return 302 /$1; }

                proxy_pass http://omec;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;

                location /config   { alias /opt/oddmuse-emacsconf/data/config; default_type text/plain; }
                location /s/ { root /opt/oddmuse-emacsconf/data; }
                location /videos {
                        alias /var/www/video.emacsconf.org;
                        autoindex on;
                        autoindex_exact_size off;
                }
        }
}