refactor: 将 nginx gzip 压缩配置移至 server 块内部

This commit is contained in:
fawney19
2026-01-07 15:10:11 +08:00
parent 0061fc04b7
commit 084bbc0bef
2 changed files with 18 additions and 18 deletions

View File

@@ -51,15 +51,6 @@ RUN printf '%s\n' \
' "" $remote_addr;' \
'}' \
'' \
'# gzip 压缩配置(对 base64 图片等非流式响应有效)' \
'gzip on;' \
'gzip_min_length 256;' \
'gzip_comp_level 5;' \
'gzip_vary on;' \
'gzip_proxied any;' \
'gzip_types application/json text/plain text/css text/javascript application/javascript application/octet-stream;' \
'gzip_disable "msie6";' \
'' \
'server {' \
' listen 80;' \
' server_name _;' \
@@ -67,6 +58,15 @@ RUN printf '%s\n' \
' index index.html;' \
' client_max_body_size 100M;' \
'' \
' # gzip 压缩配置(对 base64 图片等非流式响应有效)' \
' gzip on;' \
' gzip_min_length 256;' \
' gzip_comp_level 5;' \
' gzip_vary on;' \
' gzip_proxied any;' \
' gzip_types application/json text/plain text/css text/javascript application/javascript application/octet-stream;' \
' gzip_disable "msie6";' \
'' \
' location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {' \
' expires 1y;' \
' add_header Cache-Control "public, no-transform";' \

View File

@@ -52,15 +52,6 @@ RUN printf '%s\n' \
' "" $remote_addr;' \
'}' \
'' \
'# gzip 压缩配置(对 base64 图片等非流式响应有效)' \
'gzip on;' \
'gzip_min_length 256;' \
'gzip_comp_level 5;' \
'gzip_vary on;' \
'gzip_proxied any;' \
'gzip_types application/json text/plain text/css text/javascript application/javascript application/octet-stream;' \
'gzip_disable "msie6";' \
'' \
'server {' \
' listen 80;' \
' server_name _;' \
@@ -68,6 +59,15 @@ RUN printf '%s\n' \
' index index.html;' \
' client_max_body_size 100M;' \
'' \
' # gzip 压缩配置(对 base64 图片等非流式响应有效)' \
' gzip on;' \
' gzip_min_length 256;' \
' gzip_comp_level 5;' \
' gzip_vary on;' \
' gzip_proxied any;' \
' gzip_types application/json text/plain text/css text/javascript application/javascript application/octet-stream;' \
' gzip_disable "msie6";' \
'' \
' location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {' \
' expires 1y;' \
' add_header Cache-Control "public, no-transform";' \