summaryrefslogtreecommitdiffstats
path: root/puszcza.jopek.eu.conf
blob: d05077a663d47afe5841080967ae1fe785061717 (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
server {
    server_name puszcza.jopek.eu www.puszcza.jopek.eu;
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    index index.html index.php;

    location /admin {
        auth_basic "Uploaded files";
        auth_basic_user_file "/var/www/puszcza.jopek.eu/http.passwords";
        alias /var/www/puszcza.jopek.eu/public;
    }
    location /admin/cgi-bin/ {
        auth_basic "Uploaded files";
        auth_basic_user_file "/var/www/puszcza.jopek.eu/http.passwords";
        alias /var/www/puszcza.jopek.eu/cgi-bin/;
        fastcgi_pass  unix:/run/fcgiwrap.sock;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }

    location / {
        root /var/www/puszcza.jopek.eu/uploads;
        try_files $uri $uri.html $uri/;
    }

    ssl_certificate /etc/acme.sh/jopek.eu_ecc/fullchain.cer;
    ssl_certificate_key /etc/acme.sh/jopek.eu_ecc/jopek.eu.key;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    server_name puszcza.jopek.eu www.puszcza.jopek.eu;
    listen 80;
    listen [::]:80;

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