Merge lp:~abentley/charms/precise/charmworld/proxy-cache-key into lp:~juju-jitsu/charms/precise/charmworld/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 29
Proposed branch: lp:~abentley/charms/precise/charmworld/proxy-cache-key
Merge into: lp:~juju-jitsu/charms/precise/charmworld/trunk
Diff against target: 83 lines (+20/-7)
5 files modified
README.md (+2/-1)
hooks/install (+1/-0)
nginx/cache-log.conf (+9/-0)
nginx/http (+7/-5)
revision (+1/-1)
To merge this branch: bzr merge lp:~abentley/charms/precise/charmworld/proxy-cache-key
Reviewer Review Type Date Requested Status
Juju-Jitsu Hackers Pending
Review via email: mp+144183@code.launchpad.net

Description of the change

Configure cache in ngnix

Implement caching via nginx configuration. Also, add cache logging.

As a driveby, fix documentation.

https://codereview.appspot.com/7183045/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.md'
--- README.md 2013-01-11 20:53:06 +0000
+++ README.md 2013-01-21 21:04:21 +0000
@@ -19,7 +19,8 @@
1919
20Deploy Charmworld20Deploy Charmworld
2121
22 juju deploy juju deploy cs:~juju-jitsu/precise/charmworld --constraints instance-type=m1.small22 juju deploy cs:~juju-jitsu/precise/charmworld --constraints \
23 instance-type=m1.small
2324
24Once deployed relate mongodb to charmworld25Once deployed relate mongodb to charmworld
2526
2627
=== modified file 'hooks/install'
--- hooks/install 2013-01-10 20:15:14 +0000
+++ hooks/install 2013-01-21 21:04:21 +0000
@@ -6,6 +6,7 @@
6apt-get install -y bzr nginx python-virtualenv python-dev python-dateutil \6apt-get install -y bzr nginx python-virtualenv python-dev python-dateutil \
7 charm-helper-sh build-essential7 charm-helper-sh build-essential
8cp nginx/http /etc/nginx/sites-available/default8cp nginx/http /etc/nginx/sites-available/default
9cp nginx/cache-log.conf /etc/nginx/conf.d
9service nginx restart10service nginx restart
1011
11mkdir -p ~ubuntu/var/charms12mkdir -p ~ubuntu/var/charms
1213
=== added file 'nginx/cache-log.conf'
--- nginx/cache-log.conf 1970-01-01 00:00:00 +0000
+++ nginx/cache-log.conf 2013-01-21 21:04:21 +0000
@@ -0,0 +1,9 @@
1log_format cache '***$time_local '
2 '$upstream_cache_status '
3 'Cache-Control: $upstream_http_cache_control '
4 'Expires: $upstream_http_expires '
5 '$host '
6 '"$request" ($status) '
7 '"$http_user_agent" '
8 'Args: $args ';
9access_log /var/log/nginx/cache.log cache;
010
=== modified file 'nginx/http'
--- nginx/http 2013-01-10 20:15:14 +0000
+++ nginx/http 2013-01-21 21:04:21 +0000
@@ -27,18 +27,18 @@
2727
28server {28server {
2929
30 root /usr/share/nginx/www;30 root /usr/share/nginx/www;
31 index index.html index.htm;31 index index.html index.htm;
3232
3333
34 location /docs {34 location /docs {
35 gzip on;35 gzip on;
36 alias /home/ubuntu/docs/trunk/build/html;36 alias /home/ubuntu/docs/trunk/build/html;
37 expires 5m;37 expires 5m;
38 }38 }
3939
40 location /static {40 location /static {
41 gzip on;41 gzip on;
42 expires 48h;42 expires 48h;
43 alias /home/ubuntu/charmworld/charmworld/static;43 alias /home/ubuntu/charmworld/charmworld/static;
44 }44 }
@@ -51,6 +51,8 @@
51 proxy_pass http://pyramid;51 proxy_pass http://pyramid;
52 proxy_cache my-cache;52 proxy_cache my-cache;
53 proxy_cache_use_stale updating;53 proxy_cache_use_stale updating;
54 proxy_cache_valid 404 30m;54 proxy_cache_valid 404 30m;
55 proxy_cache_valid 15m;
56 proxy_cache_key "$host$request_uri$cookie_auth_tkt";
55 }57 }
56}58}
5759
=== modified file 'revision'
--- revision 2013-01-17 15:10:02 +0000
+++ revision 2013-01-21 21:04:21 +0000
@@ -1,1 +1,1 @@
113114

Subscribers

People subscribed via source and target branches

to all changes: