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