server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name blablabla.bla;
root /var/www/some/folder/web;
index index.php;
access_log /var/log/nginx/some_access.log;
error_log /var/log/nginx/some_error.log;
if ($allowed_country = no) {
return 404 http://blablabla.bla/block.html;
}
location / {
# Redirect everything that isn't a real file to index.php
rewrite ^/(.*)/$ /$1 permanent;
try_files $uri /index.php$is_args$args;
}
location /redirect { try_files $uri @billing; }
location @billing {
include uwsgi_params;
uwsgi_pass unix:/tmp/blablabla.sock;
}
# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Путь до сокета демона PHP-FPM
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
try_files $uri =404;
}
location ~* /\. {
deny all;
}
}