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