diff --git a/deploy/config/local/nginx/server.conf b/deploy/config/local/nginx/server.conf index 3559ea15f..aef7686c6 100644 --- a/deploy/config/local/nginx/server.conf +++ b/deploy/config/local/nginx/server.conf @@ -71,8 +71,14 @@ server { # Empty location blocks to allow access when "/" location # sends an HTTP 503 during maintenance mode - location /app/themes/clarity/error-pages/ { } - location /app/themes/clarity/dist/ { } + location /app/themes/clarity/error-pages/ { + # If the file exists, serve it directly, else return 404. + try_files $uri =404; + } + location /app/themes/clarity/dist/ { + # If the file exists, serve it directly, else return 404. + try_files $uri =404; + } # Rewrite old upload URLs to the bedrock equivalent location /wp-content/uploads/ { diff --git a/deploy/config/server.conf b/deploy/config/server.conf index 49a3b974d..3d3c29d09 100644 --- a/deploy/config/server.conf +++ b/deploy/config/server.conf @@ -90,8 +90,14 @@ server { # Empty location blocks to allow access when "/" location # sends an HTTP 503 during maintenance mode - location /app/themes/clarity/error-pages/ { } - location /app/themes/clarity/dist/ { } + location /app/themes/clarity/error-pages/ { + # If the file exists, serve it directly, else return 404. + try_files $uri =404; + } + location /app/themes/clarity/dist/ { + # If the file exists, serve it directly, else return 404. + try_files $uri =404; + } # Rewrite old upload URLs to the bedrock equivalent location /wp-content/uploads/ {