diff --git a/terraform/applications/nginx-waf/nginx/conf.d/default.conf b/terraform/applications/nginx-waf/nginx/conf.d/default.conf index 13b73f10..b987ae25 100644 --- a/terraform/applications/nginx-waf/nginx/conf.d/default.conf +++ b/terraform/applications/nginx-waf/nginx/conf.d/default.conf @@ -31,7 +31,6 @@ server { proxy_set_header Host $cf_forwarded_host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; - error_page 403 404 =404 @fourohfour; } location / { @@ -43,7 +42,6 @@ server { proxy_set_header Host $cf_forwarded_host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; - error_page 403 404 =404 @fourohfour; } } @@ -57,17 +55,19 @@ server { rewrite ^ $error_page; - proxy_hide_header Content-Type; - add_header Content-Type 'text/html'; - include nginx/snippets/proxy-to-static.conf; + + proxy_hide_header Content-Type; + + + break; } location = /favicon.ico { log_not_found off; access_log off; } - + location / { rewrite ^([^.]*[^/])$ $1/; rewrite (.*)/$ $1/index.html last; @@ -222,6 +222,6 @@ server { #include nginx/dynamic/deny-by-domain.conf; # include nginx/snippets/ip-restrict-static.conf; include nginx/snippets/proxy-to-storage.conf; - error_page 403 = @fourohfour; + error_page 403 404 =404 @fourohfour; } }