Skip to content
Snippets Groups Projects
default.conf 1.17 KiB
Newer Older
Michael.Menk's avatar
Michael.Menk committed
server {
    listen 80;
    server_name localhost;
    root /var/www/site/htdocs;
    #    error_log  /var/log/nginx/error_log  warn;


    index index.php;

    charset utf-8;

    location = /favicon.ico {
        access_log off;
        log_not_found off;
        rewrite ^/favicon.ico$ https://shared.app.uib.no/img/uib-favicon.ico permanent;
    }
    location = /robots.txt {
        access_log off;
        log_not_found off;
        return 200 "User-agent: *\nDisallow: /";
    }

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

    location ~ \.php$ {
Michael.Menk's avatar
Michael.Menk committed
        fastcgi_pass 127.0.0.1:9000;
Michael.Menk's avatar
Michael.Menk committed
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ ^/(fpm-status|ping)$ {
        if ( $args ~ 'full' ) {
            #Prevent information leaks
            return 403;
        }
        fastcgi_pass 127.0.0.1:9000;
Michael.Menk's avatar
Michael.Menk committed
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
        #Add small cache to limit abuse in case there is a varnish cache.
        expires 10s;
    }


    location ~ /\.(?!well-known).* {
        deny all;
    }
}