Modification : etc/nginx/site.d/lhc-stats/site.conf : intègre de la conf de piwik...
[lhc/ateliers.git] / etc / nginx / site.d / sympa / site.conf
1 server_name sympa.heureux-cyclage.org sympa.cyclocoop.org;
2
3 client_body_buffer_size 8k;
4 client_max_body_size 10m;
5 location /static-sympa {
6 alias /var/lib/sympa/static_content;
7 }
8 location ~ /\. {
9 access_log off;
10 deny all;
11 log_not_found off;
12 }
13 location / {
14 include /etc/nginx/conf.d/fastcgi.conf;
15 set $no_cache "0";
16 if ($request_method !~ ^(GET|HEAD)$) {
17 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
18 set $no_cache "1";
19 }
20 if ($no_cache = "1") {
21 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
22 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
23 add_header X-Microcachable "0";
24 }
25 if ($http_cookie ~* "_mcnc") {
26 # NOTE: bypass cache if no-cache cookie is set.
27 set $no_cache "1";
28 }
29 fastcgi_cache_bypass $no_cache;
30 fastcgi_cache_use_stale updating;
31 fastcgi_cache_valid 200 10s;
32 fastcgi_cache_valid 404 30m;
33 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
34 fastcgi_no_cache $no_cache;
35 fastcgi_param SCRIPT_NAME '';
36 fastcgi_param SERVER_NAME $host;
37 fastcgi_param PATH_INFO $uri;
38
39 fastcgi_pass_header Cookie;
40 fastcgi_pass_header Set-Cookie;
41 fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
42
43 fastcgi_pass unix:/run/spawn-fcgi/sympa;
44 }
45
46 # vim: ft=sh