
server {
    server_name test.bratstvopera.ru ;

    listen 127.0.0.1:8081;

    charset utf-8;

    gzip on;
    gzip_min_length 1024;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/css image/x-ico application/pdf image/jpeg image/png image/gif application/javascript application/x-javascript application/x-pointplus;
    gzip_comp_level 1;
    
    set $root_path /var/www/bratstvopera/data/www/test.bratstvopera.ru;
    root $root_path;
    disable_symlinks if_not_owner from=$root_path;

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

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;fastcgi_pass unix:/var/run/test.bratstvopera.ru.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
     }


    location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico|7z|doc|docx|map|ogg|otf|pdf|ttf|tif|txt|wav|webp|woff|woff2|xls|xlsx|xml)$ {
        try_files $uri $uri/ /index.php?$args;
    }

    location @fallback {fastcgi_pass unix:/var/run/test.bratstvopera.ru.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }

    include "/etc/nginx/fastpanel2-sites/bratstvopera/test.bratstvopera.ru.includes";
    include /etc/nginx/fastpanel2-includes/*.conf;

    error_log /var/www/bratstvopera/data/logs/test.bratstvopera.ru-frontend.error.log;
    access_log /var/www/bratstvopera/data/logs/test.bratstvopera.ru-frontend.access.log;
}