Merge ~hloeung/content-cache-charm:nginx-config2 into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: d2627b0300f45d7baebb9bd97ee2c45f24a6761b
Merged at revision: 2ec5ffab707dc0e8c9e8bd48cb8f8f840e371306
Proposed branch: ~hloeung/content-cache-charm:nginx-config2
Merge into: content-cache-charm:master
Diff against target: 78 lines (+9/-1)
5 files modified
templates/nginx_cfg.tmpl (+3/-1)
tests/unit/files/nginx_config_rendered_test_output-site10.local.txt (+1/-0)
tests/unit/files/nginx_config_rendered_test_output-site2.local.txt (+2/-0)
tests/unit/files/nginx_config_rendered_test_output-site4.local.txt (+2/-0)
tests/unit/files/nginx_config_rendered_test_output-site9.local.txt (+1/-0)
Reviewer Review Type Date Requested Status
Loïc Gomez +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+440363@code.launchpad.net

Commit message

Include X-Cache-Status to all

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Loïc Gomez (kotodama) :
review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 2ec5ffab707dc0e8c9e8bd48cb8f8f840e371306

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/templates/nginx_cfg.tmpl b/templates/nginx_cfg.tmpl
2index 864f844..016c27c 100644
3--- a/templates/nginx_cfg.tmpl
4+++ b/templates/nginx_cfg.tmpl
5@@ -45,8 +45,10 @@ server {
6 proxy_set_header X-Forwarded-Port "";
7 proxy_set_header X-Forwarded-Proto "";
8 proxy_set_header X-Forwarded-Scheme "";
9-
10+{% endif %}
11 add_header X-Cache-Status "$upstream_cache_status from {{juju_unit}}";
12+{%- if conf['backend'] %}
13+
14 {%- for key, value in conf.items()|sort(attribute='0') -%}
15 {%- if key.startswith('cache-') and value != 'None' %}
16 {%- if key == 'cache-valid' %}
17diff --git a/tests/unit/files/nginx_config_rendered_test_output-site10.local.txt b/tests/unit/files/nginx_config_rendered_test_output-site10.local.txt
18index 3375fb2..8f4f7e7 100644
19--- a/tests/unit/files/nginx_config_rendered_test_output-site10.local.txt
20+++ b/tests/unit/files/nginx_config_rendered_test_output-site10.local.txt
21@@ -9,6 +9,7 @@ server {
22
23 location / {
24 proxy_cache 009171e23968-cache;
25+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
26 root /var/www/html;
27 if ($args ~* ".*call_user.*") { rewrite ^ /? permanent; }
28 if ($args ~* ".*call_user2.*") { rewrite ^ /? permanent; } else { rewrite ^ /somewherelse? permanent; }
29diff --git a/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt b/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt
30index 8a3fa3c..6264b6e 100644
31--- a/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt
32+++ b/tests/unit/files/nginx_config_rendered_test_output-site2.local.txt
33@@ -32,12 +32,14 @@ server {
34
35 location /my-local-content/ {
36 proxy_cache 9813f9fe7826-cache;
37+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
38 root /var/www/html;
39 }
40
41
42 location /my-local-content2/ {
43 proxy_cache 9813f9fe7826-cache;
44+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
45 root /var/www/html;
46 }
47
48diff --git a/tests/unit/files/nginx_config_rendered_test_output-site4.local.txt b/tests/unit/files/nginx_config_rendered_test_output-site4.local.txt
49index 681a1fb..ea197ce 100644
50--- a/tests/unit/files/nginx_config_rendered_test_output-site4.local.txt
51+++ b/tests/unit/files/nginx_config_rendered_test_output-site4.local.txt
52@@ -9,12 +9,14 @@ server {
53
54 location / {
55 proxy_cache a0bfaa048a6f-cache;
56+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
57 autoindex on;
58 }
59
60
61 location /ubuntu/pool/ {
62 proxy_cache a0bfaa048a6f-cache;
63+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
64 autoindex on;
65 auth_request /auth;
66 }
67diff --git a/tests/unit/files/nginx_config_rendered_test_output-site9.local.txt b/tests/unit/files/nginx_config_rendered_test_output-site9.local.txt
68index f0aa33c..c5891ea 100644
69--- a/tests/unit/files/nginx_config_rendered_test_output-site9.local.txt
70+++ b/tests/unit/files/nginx_config_rendered_test_output-site9.local.txt
71@@ -33,6 +33,7 @@ server {
72
73 location /private/content {
74 proxy_cache 8facdb232d5b-cache;
75+ add_header X-Cache-Status "$upstream_cache_status from mock-content-cache/0";
76 root /srv/example1.com/content/;
77 autoindex on;
78 auth_request /auth;

Subscribers

People subscribed via source and target branches