From 985e334396085490821d32ce8d70074370b62544 Mon Sep 17 00:00:00 2001 From: tiananlin Date: Fri, 30 Oct 2026 16:13:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Dockerfiles/default.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfiles/default.conf | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfiles/default.conf diff --git a/Dockerfiles/default.conf b/Dockerfiles/default.conf new file mode 100644 index 0000000..183bcef --- /dev/null +++ b/Dockerfiles/default.conf @@ -0,0 +1,33 @@ +server { + listen 80; + server_name localhost; + + # 基础设置 + root /usr/share/nginx/html; + index index.html index.htm; + + try_files $uri $uri/ /index.html; + + client_max_body_size 100m; + + # 错误页面配置 + error_page 500 502 503 504 /50x.html; + location = /50x.html { + internal; # 仅用于内部错误请求 + } + + # Gzip 压缩设置 + gzip on; + gzip_min_length 1k; + gzip_comp_level 6; + gzip_types text/plain text/css text/javascript application/json + application/javascript application/x-javascript application/xml; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + + # 静态资源缓存优化 + location ~* \.(jpg|jpeg|gif|ico|css|js)$ { + expires 7d; + add_header Cache-Control "public, no-transform"; + } +} \ No newline at end of file