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