From 8243058d98f1b746828c6c782aa750758ba0a6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Tue, 7 Apr 2026 12:11:54 +0200 Subject: [PATCH] fix in reverse --- reverse-proxy/nginx.conf.template | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/reverse-proxy/nginx.conf.template b/reverse-proxy/nginx.conf.template index e78f843..87e3ebd 100644 --- a/reverse-proxy/nginx.conf.template +++ b/reverse-proxy/nginx.conf.template @@ -1,3 +1,8 @@ +map $uri $static_file { + ~*\.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ 1; + default 0; +} + server { listen 80 default_server; server_name ${SERVER_NAME}; @@ -38,12 +43,13 @@ server { location / { proxy_pass http://web:80/; + try_files $uri =404; + + if ($static_file) { + add_header Cache-Control "public, max-age=31536000, immutable" always; + } + add_header Cache-Control "no-store, no-cache" always; } - location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ { - proxy_pass http://web:80/; - add_header Cache-Control "public, max-age=31536000, immutable" always; - } - }