robinp7720/Blue-Stats-Minecraft

View on GitHub
nginx-sample.conf

Summary

Maintainability
Test Coverage
server {
    listen 80;

    root /var/www/*root*;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name *domain*;

    location ~ (\.json) {
        return 404;
    }

    location / {
        try_files $uri $uri/ @rewrite;
    }

    location @rewrite {
        rewrite ^/([^/]*)/$  /index.php?page=$1 last;
        rewrite ^/([^/]*)/(.*)/$  /index.php?page=$1&id=$2 last;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }    
}