Correction : nginx : échappement regexp.
[lhc/ateliers.git] / etc / nginx / site.d / caldavzap / site.conf
1 server_name
2 caldavzap.heureux-cyclage.org
3 caldavzap.cyclocoop.org;
4
5 client_body_buffer_size 1024k;
6 client_max_body_size 10m;
7
8 location ~* ^/davical/htdocs/caldav\.php(|/.*)$ {
9 root /usr/share/;
10 keepalive_timeout 10;
11 include /etc/nginx/conf.d/fastcgi.conf;
12 set $no_cache "0";
13 if ($request_method !~ ^(GET|HEAD)$) {
14 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
15 set $no_cache "1";
16 }
17 if ($no_cache = "1") {
18 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
19 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
20 add_header X-Microcachable "0";
21 }
22 if ($http_cookie ~* "_mcnc") {
23 # NOTE: bypass cache if no-cache cookie is set
24 set $no_cache "1";
25 }
26 fastcgi_cache_bypass $no_cache;
27 fastcgi_cache_use_stale updating;
28 fastcgi_cache_valid 200 10s;
29 fastcgi_cache_valid 404 10m;
30 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
31 fastcgi_index index.php;
32 fastcgi_split_path_info ^(.+\.php)(/.+)$;
33 fastcgi_param PATH_INFO $fastcgi_path_info;
34 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
35 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
36 fastcgi_no_cache $no_cache;
37 fastcgi_param REDIRECT_STATUS 200;
38 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
39 fastcgi_pass_header Cookie;
40 fastcgi_pass_header Set-Cookie;
41
42 fastcgi_pass unix:/run/php5/fpm/davical;
43 }
44 location ~* ^/davical/htdocs/.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
45 root /usr/share/;
46 access_log off;
47 expires 30d;
48 log_not_found off;
49 }
50 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
51 access_log off;
52 expires 30d;
53 log_not_found off;
54 }
55 location ~ /\. {
56 access_log off;
57 deny all;
58 log_not_found off;
59 }
60 #location ~ \.php$ {
61 # include /etc/nginx/conf.d/fastcgi.conf;
62 # fastcgi_index index.php;
63 # #fastcgi_param PATH_INFO $fastcgi_path_info;
64 # #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
65 # #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
66 # fastcgi_param REDIRECT_STATUS 200;
67 # # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
68 # fastcgi_split_path_info ^(.+\.php)(/.+)$;
69 #
70 # fastcgi_pass unix:/run/php5/fpm/caldavzap;
71 # }
72
73 # vim: ft=sh