summaryrefslogtreecommitdiffstats
path: root/roles/wiki/files/etc/nginx/sites-available/website
blob: cd6832a45f86d6aa0719a648a8c5f1c26ae6e830 (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
server {
    listen      80;
    listen [::]:80;

    server_name     fripost.org;
    server_name www.fripost.org;

    include /etc/lacme/nginx.conf;

    access_log /var/log/nginx/www.access.log;
    error_log  /var/log/nginx/www.error.log info;

    location / {
        return 301 https://$host$request_uri;
    }
}


server {
    listen      443 ssl http2;
    listen [::]:443 ssl http2;

    server_name     fripost.org;
    server_name www.fripost.org;

    access_log /var/log/nginx/www.access.log;
    error_log  /var/log/nginx/www.error.log info;

    include snippets/headers.conf;
    add_header Content-Security-Policy
               "default-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self'; frame-ancestors 'none'; form-action https://www.paypal.com/; base-uri fripost.org www.fripost.org";

    include snippets/ssl.conf;
    ssl_certificate     ssl/www.fripost.org.pem;
    ssl_certificate_key ssl/www.fripost.org.key;
    include             snippets/fripost.org.hpkp-hdr;

    gzip on;
    gzip_vary on;
    gzip_min_length 256;
    gzip_types application/font-woff application/font-woff2 application/javascript application/json application/xml image/svg+xml image/x-icon text/css text/plain;

    location / {
        try_files $uri $uri/ =404;
        index index.html;
        root /var/lib/ikiwiki/public_html/fripost-wiki/website;
    }
    location = /ikiwiki.cgi { internal; }
    location /static/ {
        alias /var/lib/ikiwiki/public_html/fripost-wiki/static/;
    }
    location /material/ {
        alias /var/www/fripost.org/material/;
    }
    location /minutes/ {
        alias /var/www/fripost.org/minutes/;
    }
    location /.well-known/autoconfig/ {
        alias /var/www/fripost.org/autoconfig/;
    }
}