6da4f66dd089afc23aa0a4485f05bbd1c9725e7d
[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 sympa.velosenville.heureux-cyclage.org
14 sympa.velosenville.org;
15
16 client_body_buffer_size 8k;
17 client_max_body_size 10m;
18 location /static-sympa {
19 alias /var/lib/sympa/static_content;
20 }
21 location ~ /\. {
22 access_log off;
23 deny all;
24 log_not_found off;
25 }
26 location / {
27 include /etc/nginx/conf.d/fastcgi.conf;
28 set $no_cache "0";
29 if ($request_method !~ ^(GET|HEAD)$) {
30 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
31 set $no_cache "1";
32 }
33 if ($no_cache = "1") {
34 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
35 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
36 add_header X-Microcachable "0";
37 }
38 if ($http_cookie ~* "_mcnc") {
39 # NOTE: bypass cache if no-cache cookie is set.
40 set $no_cache "1";
41 }
42 fastcgi_cache_bypass $no_cache;
43 fastcgi_cache_use_stale updating;
44 fastcgi_cache_valid 200 10s;
45 fastcgi_cache_valid 404 30m;
46 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
47 fastcgi_no_cache $no_cache;
48 fastcgi_param SCRIPT_NAME '';
49 set $sympa_robot $host;
50 if ($host = "sympa.chatperche.heureux-cyclage.org") {
51 set $sympa_robot "sympa.chatperche.org";
52 }
53 if ($host = "sympa.cyclocoop.heureux-cyclage.org") {
54 set $sympa_robot "sympa.cyclocoop.org";
55 }
56 if ($host = "sympa.etudesetchantiers.heureux-cyclage.org") {
57 set $sympa_robot "sympa.etudesetchantiers.org";
58 }
59 if ($host = "sympa.lesjantesdunord.heureux-cyclage.org") {
60 set $sympa_robot "sympa.lesjantesdunord.org";
61 }
62 if ($host = "sympa.ptitvelo.heureux-cyclage.org") {
63 set $sympa_robot "sympa.ptitvelo.net";
64 }
65 if ($host = "sympa.velosenville.heureux-cyclage.org") {
66 set $sympa_robot "sympa.velosenville.org";
67 }
68 fastcgi_param SERVER_NAME $sympa_robot;
69 fastcgi_param PATH_INFO $uri;
70
71 fastcgi_pass_header Cookie;
72 fastcgi_pass_header Set-Cookie;
73 fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
74
75 fastcgi_pass unix:/run/spawn-fcgi/sympa;
76 }
77
78 # vim: ft=sh