summaryrefslogtreecommitdiff
path: root/confs/pantsu.cat.conf
blob: 362ac45ed851fb676d887a1b54ca5252521519c0 (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
server {
    listen 443 ssl  deferred http2;
    listen [::]:443 ssl deferred http2; 

    server_name pantsu.cat www.pantsu.cat;
    root /mnt/pantsu/http/pantsu.cat/upload;
    include /etc/nginx/includes/lets.conf;
 
    ssl_certificate /etc/nginx/ssl/pantsu.cat/pantsu.cat_chain.pem;
    ssl_certificate_key /etc/nginx/ssl/pantsu.cat/pantsu.cat.key;
    add_header Public-Key-Pins 'pin-sha256="iLplfPiBVaaSmbk1Q0A+cY+nkeT0CyWXsjYNWAsI5UI="; pin-sha256="uynduGXAGjJl+B8om1uAZuG+2a9Guk58fjfztwMJGJc=";max-age=5184000;';

    include /etc/nginx/includes/ssllax.conf;
    location /upload.php {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/htpasswd;
    	include /etc/nginx/includes/php.conf;
    }
    	include /etc/nginx/includes/php.conf;


    location ^~ /includes/ {
         deny all;
    }
    location ^~ /pub/ {
	autoindex on;
    	include /etc/nginx/includes/php.conf;
}
    location ^~ /firefox/ {
        add_header Content-Security-Policy "default-src 'self'; script-src 'self'; connect-src 'self'; img-src 'self' https://addons.cdn.mozilla.net https://static.addons.mozilla.net; style-src 'self' 'unsafe-inline';font-src 'self';";
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
    include /etc/nginx/includes/cache.conf;

}
 
# redirect all http traffic to https
#lel doesn't work
server {
    listen 80;
    listen [::]:80;
    server_name pantsu.cat www.pantsu.cat;
    include /etc/nginx/includes/lets.conf;
    return 301 https://$host$request_uri;

}