From 911a6b51053ac8ac537b58d46a5dca493098d2c1 Mon Sep 17 00:00:00 2001 From: Mike Holloway Date: Sun, 7 Dec 2025 18:38:38 -0500 Subject: [PATCH] nginx - map directive in supplementary conf file along with invocation --- files/nginx/Dockerfile | 2 +- templates/default.conf.j2 | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/files/nginx/Dockerfile b/files/nginx/Dockerfile index fb7936f..8d8f02b 100644 --- a/files/nginx/Dockerfile +++ b/files/nginx/Dockerfile @@ -1,3 +1,3 @@ FROM nginx:latest -RUN sed -i 's/\#gzip.*on;/server_tokens\toff;\n # Set the `immutable` cache control options only for assets with a cache busting `v` argument\n map $arg_v $asset_immutable {\n "" "";\n default ", immutable";\n\n }\n #gzip\ton;/' /etc/nginx/nginx.conf +RUN sed -i 's/\#gzip.*on;/server_tokens\toff;\n #gzip\ton;/' /etc/nginx/nginx.conf diff --git a/templates/default.conf.j2 b/templates/default.conf.j2 index 2321799..ce14029 100644 --- a/templates/default.conf.j2 +++ b/templates/default.conf.j2 @@ -3,6 +3,11 @@ server 127.0.0.1:9000; } + map $arg_v $asset_immutable { + "" ""; + default ", immutable"; + } + server { listen 8080;