about summary refs log tree commit diff stats
path: root/linux/conf/nginx/sites-enabled/frontpage.conf
blob: 7f7e66a1b5c62305399f7359da7621e7fb8fba24 (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
server {
    listen 8080;
    server_name frontpage.server.ank;

    #access_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_frontpage,nohostname main;
    error_log syslog:server=unix:/dev/log,facility=daemon,tag=nginx_frontpage_err,nohostname debug;

    root /srv/www/frontpage;

    index index.html index.php;

    location / {
        index index.html;
        try_files $uri $uri/ index.html index.php$is_args$args;
    }

    location ~ [^/]\.php(/|$) {

        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        # Mitigate https://httpoxy.org/ vulnerabilities
        fastcgi_param HTTP_PROXY "";

        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;

        # include the fastcgi_param setting
        include fastcgi_params;

        # SCRIPT_FILENAME parameter is used for PHP FPM determining
        #  the script name. If it is not set in fastcgi_params file,
        # i.e. /etc/nginx/fastcgi_params or in the parent contexts,
        # please comment off following line
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    }
}