location = /#CODE# {
    return 302 /#CODE#/;
}

location ^~ /#CODE#/assets/ {
    alias /home/xc_vm/Public/assets/#TYPE#/;
    # Assets are unversioned, so force conditional revalidation (ETag/Last-Modified):
    # unchanged files return a cheap 304, changed files are re-fetched immediately.
    # Prevents stale JS/CSS (blank admin pages) after a panel update.
    etag on;
    add_header Cache-Control "no-cache";
}

location ^~ /#CODE#/ {
    alias /home/xc_vm/#ALIAS#/;
    try_files $uri $uri.html $uri/ @fc_#CODE#;
    #WHITELIST#
    location ~ \.php$ {
        limit_req zone=one burst=#BURST# nodelay;
        try_files $uri @fc_#CODE#;
        fastcgi_index index.php;
        fastcgi_pass php;
        include fastcgi_params;
        fastcgi_buffering on;
        fastcgi_buffers 96 32k;
        fastcgi_buffer_size 32k;
        fastcgi_max_temp_file_size 0;
        fastcgi_keep_conn on;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    }
}

location @fc_#CODE# {
    fastcgi_index index.php;
    fastcgi_pass php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /home/xc_vm/Public/index.php;
    fastcgi_param SCRIPT_NAME /public/index.php;
    fastcgi_param XC_SCOPE #TYPE#;
    fastcgi_param XC_CODE  #CODE#;
    fastcgi_buffering on;
    fastcgi_buffers 96 32k;
    fastcgi_buffer_size 32k;
    fastcgi_max_temp_file_size 0;
    fastcgi_keep_conn on;
}
