feat(nginx): cache缓存修复
这个提交包含在:
@@ -12,6 +12,8 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
postgresql-ha:
|
postgresql-ha:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
image:
|
||||||
|
tag: 1.21.11
|
||||||
gitea:
|
gitea:
|
||||||
config:
|
config:
|
||||||
APP_NAME: Git.dev.cm
|
APP_NAME: Git.dev.cm
|
||||||
|
|||||||
@@ -11,6 +11,37 @@ spec:
|
|||||||
paths:
|
paths:
|
||||||
- pathType: Prefix
|
- pathType: Prefix
|
||||||
path: "/"
|
path: "/"
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: gitea-http
|
||||||
|
port:
|
||||||
|
number: 3000
|
||||||
|
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: gitea-http-static
|
||||||
|
namespace: infra-devops
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-buffering: "on"
|
||||||
|
nginx.ingress.kubernetes.io/configuration-snippet: |
|
||||||
|
proxy_cache cache;
|
||||||
|
proxy_cache_valid 200 302 1d;
|
||||||
|
proxy_cache_valid 404 10m;
|
||||||
|
proxy_cache_valid any 1h;
|
||||||
|
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
|
||||||
|
proxy_cache_bypass $http_x_purge;
|
||||||
|
proxy_ignore_headers Cache-Control;
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: git.dev.cm
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /(assets|avatars)/.*
|
||||||
|
pathType: ImplementationSpecific
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: gitea-http
|
name: gitea-http
|
||||||
|
|||||||
@@ -42,4 +42,10 @@ spec:
|
|||||||
extraArgs:
|
extraArgs:
|
||||||
default-ssl-certificate: "kube-system/dev-cm-crt"
|
default-ssl-certificate: "kube-system/dev-cm-crt"
|
||||||
config:
|
config:
|
||||||
use-forwarded-headers: "true"
|
use-forwarded-headers: "true"
|
||||||
|
allow-snippet-annotations: "true"
|
||||||
|
http-snippet: |
|
||||||
|
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
|
||||||
|
proxy_cache_key $scheme$proxy_host$request_uri;
|
||||||
|
proxy_cache_lock on;
|
||||||
|
proxy_cache_use_stale updating;
|
||||||
在新议题中引用
屏蔽一个用户