From 20119a2953f40106ebbe27dc46bd05774b28a39e Mon Sep 17 00:00:00 2001 From: rohow Date: Thu, 5 Sep 2024 19:44:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(fillCode):=20=E6=96=B0=E5=A2=9EfillCode?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fillcode}/certificate-fillcode-com.yaml | 4 +- apps/apps/fillcode/ingress-http.yaml | 24 + .../{certs => nginx}/certificate-dev-cm.yaml | 0 apps/infra/net/nginx/configmap-html.yaml | 557 ++++++++++++++++-- apps/infra/net/nginx/error.html | 243 ++++++++ apps/infra/net/nginx/helmchart.yaml | 2 +- 6 files changed, 791 insertions(+), 39 deletions(-) rename apps/{infra/net/certs => apps/fillcode}/certificate-fillcode-com.yaml (83%) create mode 100644 apps/apps/fillcode/ingress-http.yaml rename apps/infra/net/{certs => nginx}/certificate-dev-cm.yaml (100%) create mode 100644 apps/infra/net/nginx/error.html diff --git a/apps/infra/net/certs/certificate-fillcode-com.yaml b/apps/apps/fillcode/certificate-fillcode-com.yaml similarity index 83% rename from apps/infra/net/certs/certificate-fillcode-com.yaml rename to apps/apps/fillcode/certificate-fillcode-com.yaml index e521778..5d9619c 100644 --- a/apps/infra/net/certs/certificate-fillcode-com.yaml +++ b/apps/apps/fillcode/certificate-fillcode-com.yaml @@ -2,7 +2,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: fillcode-com-crt - namespace: infra-net + namespace: apps spec: secretName: fillcode-com-crt issuerRef: @@ -11,4 +11,4 @@ spec: group: cert-manager.io dnsNames: - "fillcode.com" - - "*.fillcode.com" \ No newline at end of file + - "*.fillcode.com" diff --git a/apps/apps/fillcode/ingress-http.yaml b/apps/apps/fillcode/ingress-http.yaml new file mode 100644 index 0000000..86ddce2 --- /dev/null +++ b/apps/apps/fillcode/ingress-http.yaml @@ -0,0 +1,24 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: fillcode + namespace: apps + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /fillcode +spec: + ingressClassName: nginx + tls: + - hosts: + - fillcode.com + secretName: fillcode-com-crt + rules: + - host: fillcode.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: halo + port: + number: 80 diff --git a/apps/infra/net/certs/certificate-dev-cm.yaml b/apps/infra/net/nginx/certificate-dev-cm.yaml similarity index 100% rename from apps/infra/net/certs/certificate-dev-cm.yaml rename to apps/infra/net/nginx/certificate-dev-cm.yaml diff --git a/apps/infra/net/nginx/configmap-html.yaml b/apps/infra/net/nginx/configmap-html.yaml index 2cf4e90..f616302 100644 --- a/apps/infra/net/nginx/configmap-html.yaml +++ b/apps/infra/net/nginx/configmap-html.yaml @@ -4,12 +4,13 @@ metadata: name: custom-html namespace: infra-net data: - 404.html: | + 403.html: | - 404 页面未找到 + + 403 禁止访问 -
-
+
+
-
-
-

404

+
+
+

403

-

页面未找到

-

您正在寻找的页面可能已被删除、名称已更改或暂时不可用。

- 首页 +

禁止访问此页面

+

抱歉,由于安全问题您被禁止访问此页面。
如果您认为这是个错误,请联系我们获取帮助。

+ 联系我们 +
+
+ + + + 404.html: | + + + + + + 404 页面未找到 + + + +
+
+
+
+
+
+
+
+
+

404

+
+

页面未找到

+

您正在寻找的页面可能已被删除、名称已更改或暂时不可用。

+ 回到首页 +
+
+ + + + 5xx.html: | + + + + + + 500 服务器错误 + + + +
+
+
+
+
+
+
+
+
+

500

+
+

哎呀,服务器出了点问题!

+

请稍后再试,或者返回主页。
如果问题持续存在,请联系我们,我们会尽快修复。

+ 回到首页 + 联系我们
diff --git a/apps/infra/net/nginx/error.html b/apps/infra/net/nginx/error.html new file mode 100644 index 0000000..a325a2a --- /dev/null +++ b/apps/infra/net/nginx/error.html @@ -0,0 +1,243 @@ + + + + + + 404 页面未找到 + + + +
+
+
+
+
+
+
+
+
+

404

+
+

页面未找到

+

您正在寻找的页面可能已被删除、名称已更改或暂时不可用。

+ 回到首页 +
+
+ + diff --git a/apps/infra/net/nginx/helmchart.yaml b/apps/infra/net/nginx/helmchart.yaml index 6cc9edb..26ac7df 100644 --- a/apps/infra/net/nginx/helmchart.yaml +++ b/apps/infra/net/nginx/helmchart.yaml @@ -33,7 +33,7 @@ spec: # http to https重定向 ssl-redirect: "true" # 自定义错误页面 - custom-http-errors: "404,503" + custom-http-errors: "403,404,502,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;