Modifications: etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4
[lhc/admin.git] / srv / ateliers / etc / nginx / org / heureux-cyclage / clavette-lyon / common.conf.m4
1 server_name
2 clavette-lyon.heureux-cyclage.org;
3 root /home/www/data/org/heureux-cyclage/clavette-lyon/www/;
4
5 rewrite /wp-admin$ $scheme://$host$uri/ permanent;
6 # Add trailing slash to */wp-admin requests.
7 location = /wp-admin/ {
8 return 301 /wp-admin/index.php?$args;
9 }
10 location / {
11 index index.html index.htm index.php;
12 try_files $uri $uri/ /index.php?$args;
13 }
14 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
15 access_log off;
16 expires 30d;
17 log_not_found off;
18 }
19 location ~ /\. {
20 access_log off;
21 deny all;
22 log_not_found off;
23 }
24 location ~ \.php(|/.+)$ {
25 include /etc/nginx/conf.d/fastcgi.conf;
26 set $no_cache "0";
27 if ($request_method !~ ^(GET|HEAD)$) {
28 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
29 set $no_cache "1";
30 }
31 if ($no_cache = "1") {
32 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
33 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
34 add_header X-Microcachable "0";
35 }
36 if ($http_cookie ~* "_mcnc") {
37 # NOTE: bypass cache if no-cache cookie is set
38 set $no_cache "1";
39 }
40 fastcgi_cache_bypass $no_cache;
41 fastcgi_cache_use_stale updating;
42 fastcgi_cache_valid 200 10s;
43 fastcgi_cache_valid 404 10m;
44 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
45 fastcgi_index index.php;
46 fastcgi_no_cache $no_cache;
47 fastcgi_param REDIRECT_STATUS 200;
48 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
49 fastcgi_pass_header Cookie;
50 fastcgi_pass_header Set-Cookie;
51 fastcgi_split_path_info ^(.+\.php)(/.+)$;
52 try_files $fastcgi_script_name =404;
53 # Check for path info security issue
54 fastcgi_pass unix:CAT(sys/php5/fpm/org/heureux-cyclage/clavette-lyon/socket);
55 }
56 # vim: ft=sh