Skip to content

Commit

Permalink
DIGITAL-90: Configure 404 page.
Browse files Browse the repository at this point in the history
  • Loading branch information
casey-rapnicki-bixal committed Jan 16, 2025
1 parent 80117ac commit 7e47dca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions terraform/applications/nginx-waf/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 / {
Expand All @@ -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;
}
}

Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 7e47dca

Please sign in to comment.