diff --git a/apps/infra/net/nginx/configmap-html.yaml b/apps/infra/net/nginx/configmap-html.yaml
new file mode 100644
index 0000000..2cf4e90
--- /dev/null
+++ b/apps/infra/net/nginx/configmap-html.yaml
@@ -0,0 +1,244 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: custom-html
+ namespace: infra-net
+data:
+ 404.html: |
+
+
+
+
+ 404 页面未找到
+
+
+
+
+
+
+
+
404
+
+
页面未找到
+
您正在寻找的页面可能已被删除、名称已更改或暂时不可用。
+
首页
+
+
+
+
diff --git a/apps/infra/net/nginx/helmchart.yaml b/apps/infra/net/nginx/helmchart.yaml
index 3299ed2..98b9624 100644
--- a/apps/infra/net/nginx/helmchart.yaml
+++ b/apps/infra/net/nginx/helmchart.yaml
@@ -30,6 +30,8 @@ spec:
config:
use-forwarded-headers: "true"
allow-snippet-annotations: "true"
+ # 自定义错误页面
+ custom-http-errors: "404,503"
# 缓存配置
http-snippet: |
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
@@ -114,3 +116,19 @@ spec:
- name: crowdsec-bouncer-plugin
mountPath: /etc/nginx/lua/plugins/crowdsec
subPath: crowdsec
+ defaultBackend:
+ enabled: true
+ image:
+ registry: registry.k8s.io
+ image: ingress-nginx/custom-error-pages
+ tag: v1.0.1
+ extraVolumes:
+ - name: custom-html
+ configMap:
+ name: custom-html
+ extraVolumeMounts:
+ - name: custom-html
+ mountPath: /www
+ # 和controller部署同一节点
+ nodeSelector:
+ svccontroller.k3s.cattle.io/enablelb: "true"