aboutsummaryrefslogtreecommitdiff
path: root/debian/personal-vps/nginx/conf.d/gist.conf
blob: cae660861a95efb4a7f2ee2aa5a19d7f2591b4b4 (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
server {
    charset utf-8;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    root /var/www/html/PrivateBin;
    server_name gist.valentineus.link;

    access_log off;
    error_log /var/log/nginx/gist/error.log warn;

    location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ {
        access_log off;
        expires 30d;
    }

    location ~ ^/(data|cfg|tmp) { 
        deny all; 
    } 

    location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ { 
        deny all; 
    } 

    location ~ /\. {
        deny all;
    }

    location ~ [^/]\.(php|html|htm)(/|$) {
        include fastcgi_params;
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
    }

    location / {
        index index.php;
        try_files $uri $uri/ /index.php;
    }
}