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