From aba2da0757d6d459baa431786c815c74da4e830c Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 24 May 2025 08:36:56 +0200 Subject: Serve empty error pages as text/plain not application/x-empty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So Firefox and Chromium serve a blank page resp. a generic ”HTTP ERROR 404” page. With application/x-empty Chromium serves the following This site can’t be reached The webpage at https://example.net/… might be temporarily down or it may have moved permanently to a new web address. ERR_INVALID_RESPONSE which can be confusing (even though only OpenLayer should consume those error pages). This reverts commit 1843371641f5b3898893df91094412eaeedc8807. --- files/etc/nginx/sites-available/webmap | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'files/etc/nginx/sites-available/webmap') diff --git a/files/etc/nginx/sites-available/webmap b/files/etc/nginx/sites-available/webmap index e5da0be..57368cb 100644 --- a/files/etc/nginx/sites-available/webmap +++ b/files/etc/nginx/sites-available/webmap @@ -73,7 +73,7 @@ server { brotli_static on; try_files $uri =404; # service an empty payload to save bandwidth - error_page 404 /_empty; + error_page 404 /_.txt; } location = /tiles/metadata.json { expires epoch; @@ -81,12 +81,11 @@ server { try_files $uri =404; } - location = /_empty { + location = /_.txt { # cache 404 responses for 8h like for valid tiles add_header Strict-Transport-Security "max-age=31557600; includeSubDomains" always; add_header Cache-Control "public; max-age=28800" always; #add_header Access-Control-Allow-Origin "*" always; - default_type application/x-empty; internal; } -- cgit v1.2.3