about summary refs log tree commit diff stats
path: root/tools/conf/etc/nginx/sites-enabled/default.conf
blob: c35b0cd8abecbb50b595a8e758cc55da672d2a62 (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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
server {

#listen 443 ssl http2;
    listen 443 ssl;

#    listen 80;
    server_name machine.example;

#  listen [::]:443 ssl http2;
    ssl_certificate /etc/letsencrypt/live/machine.example/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/machine.example/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/machine.example/chain.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_protocols TLSv1.2;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security max-age=15768000;
    ssl_stapling on;
    ssl_stapling_verify on;

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


    root /srv/www;

    location /ports/distfiles {
        alias /usr/ports/distfiles;
    }

    location /ports/packages {
        alias /usr/ports/distfiles;
    }

    location /doc {
        alias /srv/www/doc;
        index index.html;
    }

    location /git/static {
# static files (png/css) served from /usr/share/gitweb/static
        alias /srv/www/gitweb/static;
        expires 30d;
    }

    location /git {
        alias /srv/www/gitweb;
        index gitweb.cgi;
        fastcgi_split_path_info      ^/git()(/?.+)$;
        fastcgi_param GITWEB_CONFIG  /etc/gitweb.conf;
        fastcgi_param DOCUMENT_ROOT  /srv/www/gitweb;
        fastcgi_param SCRIPT_NAME    /gitweb.cgi$fastcgi_path_info;

        include fastcgi_params;
        fastcgi_pass unix:/var/run/fcgiwrap.sock;
    }

    location /task {
        index index.php;
        alias /srv/www/flyspray;
        try_files $uri $uri/ index.php$is_args$args;
    }

    location ~  ^/task(.+\.php)$ { ### This location block was the solution
        alias /srv/www/flyspray;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        try_files $uri /index.php =404;	
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$1;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_pass 127.0.0.1:9000;
    }

    location / {
        alias /srv/www/pmwiki/;
        index pmwiki.php;
        try_files $uri $uri/ /pmwiki.php$is_args$args;
    }

# ACME challenge
    location ^~ /.well-known {
        allow all;
        alias /srv/www/pmwiki/pub/cert/.well-known/;
        default_type "text/plain";
        try_files $uri =404;
    }


    location ~ \.php$ {
        alias /srv/www/pmwiki;
        index pmwiki.php;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index pmwiki.php;
        try_files $uri /pmwiki.php =404;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_pass 127.0.0.1:9000;
    }
}