summaryrefslogtreecommitdiff
path: root/etc/nginx/apps/drupal/microcache_fcgi_auth.conf
blob: 7b2b7c3cdc03e0d3d2aa72e915b1ad061706fad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- mode: nginx; mode: flyspell-prog;  ispell-local-dictionary: "american" -*-

## The cache zone referenced.
fastcgi_cache microcache;
## The cache key.
fastcgi_cache_key $cache_uid@$scheme$request_method$host$request_uri;

## For 200 and 301 make the cache valid for 15s.
fastcgi_cache_valid 200 301 15s;
## For 302 make it valid for 1 minute.
fastcgi_cache_valid 302 1m;
## For 404 make it valid 1 second.
fastcgi_cache_valid 404 1s;
## If there are any upstream errors use whatever it is available.
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
## The Cache-Control and Expires headers should be delivered untouched
## from the upstream to the client.
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
## Bypass the cache.
# fastcgi_cache_bypass $no_auth_cache;
# fastcgi_no_cache $no_auth_cache;
## Add a cache miss/hit status header.
add_header X-Micro-Cache $upstream_cache_status;
## To avoid any interaction with the cache control headers we expire
## everything on this location immediately.
expires epoch;

## Enable clickjacking protection in modern browsers. Available in
## IE8 also. See
## https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
## This may conflicts with pseudo streaming (at least with Nginx version 1.0.12).
## Uncomment the line below if you're not using media streaming.
## For sites *not* using frames uncomment the line below.
#add_header X-Frame-Options DENY;
## For sites *using* frames uncomment the line below.
#add_header X-Frame-Options SAMEORIGIN;

## Block MIME type sniffing on IE.
add_header X-Content-Options nosniff;

## If you're using a Nginx version greater than 1.1.11 then uncomment
## the line below. See:
## http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_cache_lock
## Cache locking mechanism for protecting the backend of too many
## simultaneous requests.
#fastcgi_cache_lock on;
## The default timeout, i.e., the time to way before forwarding the
## second request upstream if no reply as arrived in the meantime is 5s.
#fastcgi_cache_lock_timeout 8000; # in miliseconds.