~sinzui/juju-ci-tools/repository

« back to all changes in this revision

Viewing changes to charms/wordpress/files/charm/nginx/etc_nginx_sites-enabled_loadbalancer

  • Committer: seman.said at canonical
  • Date: 2016-03-25 02:02:02 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: seman.said@canonical.com-20160325020202-6fdn71nhxz9gg1a4
Added charms that supports series in metadata.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Default before peer relation is handled
 
2
proxy_cache_path /mnt/ramdisk/proxy-cache levels=1:2 keys_zone=proxycache:5m max_size=1000m;
 
3
 
 
4
upstream backend {
 
5
  server 127.0.0.1:8080;
 
6
}
 
7
 
 
8
server {
 
9
  listen 80 default;
 
10
  server_name _;
 
11
  location / {
 
12
    set $no_cache "";
 
13
 
 
14
    if ($request_method !~ ^(GET|HEAD)$) {
 
15
      set $no_cache "1";
 
16
    }
 
17
 
 
18
    if ($no_cache = "1") {
 
19
      add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
 
20
      add_header X-Microcachable "0";
 
21
    }
 
22
 
 
23
    if ($http_cookie ~* "_mcnc") {
 
24
      set $no_cache "1";
 
25
    }
 
26
 
 
27
    proxy_no_cache $no_cache;
 
28
    proxy_cache_bypass $no_cache;
 
29
 
 
30
    proxy_redirect   http://backend  /;
 
31
    proxy_pass  http://backend;
 
32
    proxy_cache proxycache;
 
33
    proxy_cache_key $scheme$host$request_method$request_uri;
 
34
    proxy_cache_valid 200 60s;
 
35
    proxy_cache_use_stale updating;
 
36
 
 
37
    proxy_set_header Host $host;
 
38
    proxy_set_header X-Real-IP $remote_addr;
 
39
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
40
 
 
41
    proxy_max_temp_file_size 1M;
 
42
 
 
43
    # Custom logging
 
44
    log_format custom '$remote_addr - $remote_user [$time_local]  '
 
45
             '"$request" $status $body_bytes_sent '
 
46
             '"$http_referer" "$http_user_agent" nocache:$no_cache';
 
47
    access_log  /mnt/logs/microcache.log custom;
 
48
 
 
49
  }
 
50
}
 
51