nginx - map directive in supplementary conf file along with invocation

This commit is contained in:
Mike Holloway 2025-12-07 18:38:38 -05:00
parent 4217f56c49
commit 911a6b5105
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,3 @@
FROM nginx:latest 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

View File

@ -3,6 +3,11 @@
server 127.0.0.1:9000; server 127.0.0.1:9000;
} }
map $arg_v $asset_immutable {
"" "";
default ", immutable";
}
server { server {
listen 8080; listen 8080;