summaryrefslogtreecommitdiff
path: root/platform/etc/nginx/www.conf.sample
blob: 1243549951211d8df1dd7bf08c0db8a13d243e43 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
server {
    listen         80;
    server_name acerv.us *.acerv.us;
    root    /srv/acerv.us/platform/www/;
    error_log  /srv/acerv.us/platform/log/nginx.error error;

    location = /favicon.ico {
      log_not_found off;
      access_log off;
    }

    location = /robots.txt {
      allow all;
      log_not_found off;
      access_log off;
    }

    index doku.php index.php;

    #Remember to comment the below out when you're installing, and uncomment it when done.
    #location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }

    location / { try_files $uri $uri/ @dokuwiki; }

    location @dokuwiki {
        # rewrites "doku.php/" out of the URLs if you set the userewrite setting to .htaccess in dokuwiki config page
        rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
        rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
        rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
        rewrite ^/(.*) /doku.php?id=$1&$args last;
    }

    location ~ \.php$ {
        try_files $uri $uri/ /doku.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
#        fastcgi_pass unix:/srv/reevo-web/run/blog.socket;
        fastcgi_pass unix:/srv/acerv.us/platform/run/acervus.socket;
		fastcgi_buffering off;
    }
}

# Define the subsites

server {
    if ($host = esteva.acerv.us) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = cidoc.acerv.us) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = illich.acerv.us) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = acerv.us) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = *.acerv.us) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen         80;
    server_name acerv.us *.acerv.us;
    return 404; # managed by Certbot

}