Modifications : etc/nginx/site.d/sympa/
[lhc/ateliers.git] / etc / nginx / site.d / sympa / site.conf
1 server_name
2 sympa.chatperche.heureux-cyclage.org
3 sympa.chatperche.org
4 sympa.cyclocoop.heureux-cyclage.org
5 sympa.cyclocoop.org
6 sympa.etudesetchantiers.heureux-cyclage.org
7 sympa.etudesetchantiers.org
8 sympa.heureux-cyclage.org
9 sympa.lesjantesdunord.heureux-cyclage.org
10 sympa.lesjantesdunord.org
11 sympa.ptitvelo.heureux-cyclage.org
12 sympa.ptitvelo.net;
13
14 client_body_buffer_size 8k;
15 client_max_body_size 10m;
16 location /static-sympa {
17 alias /var/lib/sympa/static_content;
18 }
19 location ~ /\. {
20 access_log off;
21 deny all;
22 log_not_found off;
23 }
24 location / {
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 30m;
44 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
45 fastcgi_no_cache $no_cache;
46 fastcgi_param SCRIPT_NAME '';
47 set $sympa_robot $host;
48 if ($host = "sympa.chatperche.heureux-cyclage.org") {
49 set $sympa_robot "sympa.chatperche.org";
50 }
51 if ($host = "sympa.cyclocoop.heureux-cyclage.org") {
52 set $sympa_robot "sympa.cyclocoop.org";
53 }
54 if ($host = "sympa.etudesetchantiers.heureux-cyclage.org") {
55 set $sympa_robot "sympa.etudesetchantiers.org";
56 }
57 if ($host = "sympa.lesjantesdunord.heureux-cyclage.org") {
58 set $sympa_robot "sympa.lesjantesdunord.org";
59 }
60 if ($host = "sympa.ptitvelo.heureux-cyclage.org") {
61 set $sympa_robot "sympa.ptitvelo.net";
62 }
63 fastcgi_param SERVER_NAME $sympa_robot;
64 fastcgi_param PATH_INFO $uri;
65
66 fastcgi_pass_header Cookie;
67 fastcgi_pass_header Set-Cookie;
68 fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
69
70 fastcgi_pass unix:/run/spawn-fcgi/sympa;
71 }
72
73 # vim: ft=sh