3 chatperche.heureux-cyclage.org;
4 root /home/www/data/org/chatperche/www/www;
6 rewrite /wp-admin$ $scheme://$host$uri/ permanent;
7 # Add trailing slash to */wp-admin requests.
8 location = /wp-admin/ {
9 return 301 /wp-admin/index.php?$args;
12 if ($host = "www.chatperche.org") {
13 return 302 "$scheme://ateliervelo.free.fr/";
15 index index.html index.htm index.php;
16 try_files $uri $uri/ /index.php?$args;
18 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
28 location ~ \.php(|/.+)$ {
29 include /etc/nginx/conf.d/fastcgi.conf;
31 if ($request_method !~ ^(GET|HEAD)$) {
32 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
35 if ($no_cache = "1") {
36 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
37 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
38 add_header X-Microcachable "0";
40 if ($http_cookie ~* "_mcnc") {
41 # NOTE: bypass cache if no-cache cookie is set
44 fastcgi_cache_bypass $no_cache;
45 fastcgi_cache_use_stale updating;
46 fastcgi_cache_valid 200 10s;
47 fastcgi_cache_valid 404 10m;
48 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
49 fastcgi_index index.php;
50 fastcgi_no_cache $no_cache;
51 fastcgi_param REDIRECT_STATUS 200;
52 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
53 fastcgi_pass_header Cookie;
54 fastcgi_pass_header Set-Cookie;
55 fastcgi_split_path_info ^(.+\.php)(/.+)$;
56 try_files $fastcgi_script_name =404;
57 # Check for path info security issue
58 fastcgi_pass unix:CAT(sys/php5/fpm/org/chatperche/www/socket);