From c994fd1b015db7749f529c9995a936235800d811 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Fri, 31 Jan 2020 12:45:02 +1000 Subject: [PATCH] FIX: Serve .ico files without nginx 404 for secure media uploads (#8826) Add nginx location to handle /secure-media-uploads/ requests .ico files were getting a 404 when being looked for via /secure-media-uploads/. this nginx config addition fixes the issue. --- config/nginx.sample.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 538e29fab4a..52e56609542 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -104,6 +104,16 @@ server { break; } + location ~ ^/secure-media-uploads/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Request-Start "t=${msec}"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $thescheme; + proxy_pass http://discourse; + break; + } + location ~* (assets|plugins|uploads)/.*\.(eot|ttf|woff|woff2|ico)$ { expires 1y; add_header Cache-Control public,immutable;