From 5ed878b49a1837f3e602658041e25042be0bcca6 Mon Sep 17 00:00:00 2001 From: ivamp Date: Sun, 4 Aug 2024 17:18:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(amber-web):=20=E4=BF=AE=E6=AD=A3nginx?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=92=8C=E5=BA=94=E7=94=A8=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 部署叶服务器的nginx配置文件中包含了必要的服务器配置,以确保正确地监听HTTP和HTTPS流量,并且定义了错误页面的位置。同时,更新了manifest.yaml中应用的镜像版本,以包含修复和新配置。 --- Dockerfile | 1 + manifest.yaml | 2 +- nginx.conf | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 25dc856..875dcc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM nginx:1.27.0-alpine COPY dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/manifest.yaml b/manifest.yaml index ff047dd..93e99eb 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -17,7 +17,7 @@ spec: - name: leaf containers: - name: amber - image: registry.leafdev.top/leaf/amber-web:v0.0.1 + image: registry.leafdev.top/leaf/amber-web:v0.0.1-fix-2 imagePullPolicy: IfNotPresent ports: - containerPort: 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..41889e3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file