Correction : etc/etckeeper/prompt.sh : exec $SHELL .
[lhc/ateliers.git] / etc / nginx / site.d / lhc-www / server.conf
1 client_body_buffer_size 8k;
2 client_max_body_size 10m;
3 location / {
4 index index.html index.htm index.php;
5 }
6 location ~* ^.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
7 access_log off;
8 expires 30d;
9 log_not_found off;
10 }
11 location ~ /\. {
12 access_log off;
13 deny all;
14 log_not_found off;
15 }
16 location ~ \.php$ {
17 include /etc/nginx/conf.d/fastcgi.conf;
18 set $no_cache "";
19 if ($request_method !~ ^(GET|HEAD)$) {
20 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
21 set $no_cache "1";
22 }
23 if ($no_cache = "1") {
24 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
25 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
26 add_header X-Microcachable "0";
27 }
28 if ($http_cookie ~* "_mcnc") {
29 # NOTE: bypass cache if no-cache cookie is set
30 set $no_cache "1";
31 }
32 fastcgi_cache_bypass $no_cache;
33 fastcgi_cache_use_stale updating;
34 fastcgi_cache_valid 200 10s;
35 fastcgi_cache_valid 404 30m;
36 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
37 fastcgi_max_temp_file_size 2M;
38 fastcgi_no_cache $no_cache;
39 fastcgi_pass_header Cookie;
40 fastcgi_pass_header Set-Cookie;
41 fastcgi_split_path_info ^(.+\.php)(/.+)$;
42
43 fastcgi_pass unix:/run/php5/fpm/lhc-www;
44 }
45 server_name www.heureux-cyclage.org heureux-cyclage.org;
46
47 # vim: ft=sh