-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for static cache config
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Cache settings | ||
proxy_cache_valid 404 10m; | ||
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504; | ||
proxy_cache static-cache; | ||
proxy_cache_valid any 120m; | ||
proxy_cache_bypass $http_x_purge; | ||
add_header X-Cache-Status $upstream_cache_status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{%- for service, config in DRYDOCK_NGINX_STATIC_CACHE_CONFIG.items() %} | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ingress-static-{{ service }} | ||
namespace: {{ K8S_NAMESPACE }} | ||
annotations: | ||
nginx.ingress.kubernetes.io/proxy-body-size: 8m | ||
nginx.ingress.kubernetes.io/proxy-buffering: "on" | ||
nginx.ingress.kubernetes.io/configuration-snippet: | | ||
{{ patch("static-cache-config") | indent(6)}} | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: {{ config["host"] }} | ||
http: | ||
paths: | ||
- pathType: Prefix | ||
path: {{ config["path"]}} | ||
backend: | ||
service: | ||
name: {% if DRYDOCK_BYPASS_CADDY -%}{% else -%}caddy{% endif %} | ||
port: | ||
number: {% if DRYDOCK_BYPASS_CADDY -%}{{ config["port"] }}{% else -%}80{% endif %} | ||
{%- endfor %} |