nginx.conf 1.33 KB
server {
    listen       80;
    server_name  vents.dev www.vents.dev;
    root         /var/www/domains/vents.dev/web;

    access_log  /var/log/nginx/vents.dev.access.log combined;
    error_log  /var/log/nginx/vents.dev.error.log warn;

    charset      utf-8;
    client_max_body_size  100M;

    location / {
        root  /var/www/domains/vents.dev/web;
        try_files  $uri /index.php?$args;
    }

    location ~* \.php$ {
        try_files  $uri /$uri =404;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include  fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~* \.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar)$ {
        access_log  off;
        log_not_found  off;
        try_files  $uri /$uri =404;
    }

    location ~* \.(htaccess|htpasswd|svn|git) {
        deny all;
    }

    location /backend {
        root  /var/www/domains/vents.dev/web;
        try_files  $uri /backend/index.php?$args;
    }

    location ~ ^/backend/(.+\.php) {
        try_files  $uri /$uri =404;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include  fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    
}



try_files /does_not_exists @php;