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;
10
server_name www.omgubuntu.co.uk omgubuntu.co.uk _;
14
if ($request_method !~ ^(GET|HEAD)$) {
18
if ($no_cache = "1") {
19
add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
20
add_header X-Microcachable "0";
23
if ($http_cookie ~* "_mcnc") {
27
proxy_no_cache $no_cache;
28
proxy_cache_bypass $no_cache;
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;
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;
41
proxy_max_temp_file_size 1M;
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;