mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-08 18:52:28 +08:00
refactor: 将 nginx gzip 压缩配置移至 server 块内部
This commit is contained in:
@@ -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";' \
|
||||
|
||||
@@ -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";' \
|
||||
|
||||
Reference in New Issue
Block a user