AjoutĀ : etc/sympa/host.d/sympa.vieuxbiclou.org/robot.conf.m4
[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 sympa.vieuxbiclou.heureux-cyclage.org
16 sympa.vieuxbiclou.org;
17
18 client_body_buffer_size 8k;
19 client_max_body_size 10m;
20 location /static-sympa {
21 alias /var/lib/sympa/static_content;
22 }
23 location ~ /\. {
24 access_log off;
25 deny all;
26 log_not_found off;
27 }
28 location / {
29 include /etc/nginx/conf.d/fastcgi.conf;
30 set $no_cache "0";
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.
33 set $no_cache "1";
34 }
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";
39 }
40 if ($http_cookie ~* "_mcnc") {
41 # NOTE: bypass cache if no-cache cookie is set.
42 set $no_cache "1";
43 }
44 fastcgi_cache_bypass $no_cache;
45 fastcgi_cache_use_stale updating;
46 fastcgi_cache_valid 200 10s;
47 fastcgi_cache_valid 404 30m;
48 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
49 fastcgi_no_cache $no_cache;
50 fastcgi_param SCRIPT_NAME '';
51 set $sympa_robot $host;
52 if ($host = "sympa.chatperche.heureux-cyclage.org") {
53 set $sympa_robot "sympa.chatperche.org";
54 }
55 if ($host = "sympa.cyclocoop.heureux-cyclage.org") {
56 set $sympa_robot "sympa.cyclocoop.org";
57 }
58 if ($host = "sympa.etudesetchantiers.heureux-cyclage.org") {
59 set $sympa_robot "sympa.etudesetchantiers.org";
60 }
61 if ($host = "sympa.lesjantesdunord.heureux-cyclage.org") {
62 set $sympa_robot "sympa.lesjantesdunord.org";
63 }
64 if ($host = "sympa.ptitvelo.heureux-cyclage.org") {
65 set $sympa_robot "sympa.ptitvelo.net";
66 }
67 if ($host = "sympa.velosenville.heureux-cyclage.org") {
68 set $sympa_robot "sympa.velosenville.org";
69 }
70 if ($host = "sympa.vieuxbiclou.heureux-cyclage.org") {
71 set $sympa_robot "sympa.vieuxbiclou.org";
72 }
73 fastcgi_param SERVER_NAME $sympa_robot;
74 fastcgi_param PATH_INFO $uri;
75
76 fastcgi_pass_header Cookie;
77 fastcgi_pass_header Set-Cookie;
78 fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
79
80 fastcgi_pass unix:/run/spawn-fcgi/sympa;
81 }
82
83 # vim: ft=sh