error_page 400 /400.json;
error_page 413 =400 /400.json;
error_page 429 =429 /429.json;
error_page 494 =400 /400.json;
error_page 495 496 497 =403 /403.json;
error_page 502 =503 /503.json;
location = /400.json {
    add_header x-ally-err '400 vic::vic/app' always;
    add_header x-ally-ext-err  'VIC-Waf-BadRequest' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}

error_page 404 /404.json;
location = /404.json {
    add_header x-ally-err '404 vic/app' always;
    add_header x-ally-ext-err 'VIC-Waf-ResourceNotFound' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/error-files/;
    internal;
}

location = /403.json {
    add_header x-ally-err '403 vic::vic/ccrt' always;
    add_header x-ally-ext-err  'VIC-Waf-BadCert' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}


error_page 408 /408.json;
location = /408.json {
    add_header x-ally-err '408 vic::vic/app' always;
    add_header x-ally-ext-err 'VIC-Waf-RequestTimeout' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}

error_page 429 /429.json;
location = /429.json {
    add_header x-ally-err '429 vic::vic/tech' always;
    add_header x-ally-ext-err 'VIC-Waf-TooManyRequest' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}

error_page 500 /500.json;
location = /500.json {
    add_header x-ally-err '500 vic::vic/app' always;
    add_header x-ally-ext-err 'VIC-Waf-ApplicationError' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}

error_page 503 /503.json;
location = /503.json {
    add_header x-ally-err '503 vic::vic/tech' always;
    add_header x-ally-ext-err 'VIC-Waf-ServiceUnreachable' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}

error_page 504 /504.json;
location = /504.json {
    add_header x-ally-err '504 vic::vic/tech' always;
    add_header x-ally-ext-err 'VIC-Waf-ResponseTimeout' always;
    add_header cl_conn_ctx $http_cl_conn_ctx always;
    root /etc/nginx/errors-files/;
    internal;
}
