File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed
templates/drydock/k8s/ingress Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 12
12
- plugins/drydock/k8s/ingress/cms.yml
13
13
- plugins/drydock/k8s/ingress/mfe.yml
14
14
- plugins/drydock/k8s/ingress/extra-hosts.yml
15
+ {% if DRYDOCK_NGINX_STATIC_CACHE_CONFIG %}- plugins/drydock/k8s/ingress/static-cache.yml{%- endif %}
15
16
{%- endif %}
16
17
{% if DRYDOCK_DEBUG -%}
17
18
- plugins/drydock/k8s/debug/deployments.yml
Original file line number Diff line number Diff line change
1
+ # Cache settings
2
+ proxy_cache_valid 404 10m;
3
+ proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
4
+ proxy_cache static-cache;
5
+ proxy_cache_valid any 120m;
6
+ proxy_cache_bypass $http_x_purge;
7
+ add_header X-Cache-Status $upstream_cache_status;
Original file line number Diff line number Diff line change @@ -162,6 +162,18 @@ def get_sync_waves_for_resource(resource_name: str) -> SYNC_WAVES_ORDER_ATTRS_TY
162
162
"lms-worker" ,
163
163
"cms-worker" ,
164
164
],
165
+ "NGINX_STATIC_CACHE_CONFIG" : {
166
+ "lms" : {
167
+ "host" : "{{ LMS_HOST }}" ,
168
+ "path" : "/static/" ,
169
+ "port" : 8000 ,
170
+ },
171
+ "cms" : {
172
+ "host" : "{{ CMS_HOST }}" ,
173
+ "path" : "/static/" ,
174
+ "port" : 8000 ,
175
+ },
176
+ },
165
177
},
166
178
# Add here settings that don't have a reasonable default for all users. For
167
179
# instance: passwords, secret keys, etc.
Original file line number Diff line number Diff line change
1
+ {%- for service, config in DRYDOCK_NGINX_STATIC_CACHE_CONFIG.items() %}
2
+ ---
3
+ apiVersion : networking.k8s.io/v1
4
+ kind : Ingress
5
+ metadata :
6
+ name : ingress-static-{{ service }}
7
+ namespace : {{ K8S_NAMESPACE }}
8
+ annotations :
9
+ nginx.ingress.kubernetes.io/proxy-body-size : 8m
10
+ nginx.ingress.kubernetes.io/proxy-buffering : " on"
11
+ nginx.ingress.kubernetes.io/configuration-snippet : |
12
+ {{ patch("static-cache-config") | indent(6)}}
13
+ spec :
14
+ ingressClassName : nginx
15
+ rules :
16
+ - host : {{ config["host"] }}
17
+ http :
18
+ paths :
19
+ - pathType : Prefix
20
+ path : {{ config["path"]}}
21
+ backend :
22
+ service :
23
+ name : {% if DRYDOCK_BYPASS_CADDY -%}{{ service }}{% else -%}caddy{% endif %}
24
+ port :
25
+ number : {% if DRYDOCK_BYPASS_CADDY -%}{{ config["port"] }}{% else -%}80{% endif %}
26
+ {%- endfor %}
You can’t perform that action at this time.
0 commit comments