2 davical.heureux-cyclage.org
6 client_body_buffer_size 8k;
7 client_max_body_size 10m;
9 rewrite ^\.well-known(.*)$ /caldav.php/.well-known$1;
10 rewrite ^principals/users(.*)$ /caldav.php$1;
12 error_page 404 = /404;
17 # NOTE: to get DAViCal and nginx working with iCal 6.0 clients.
18 return 301 /caldav.php$1;
20 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
21 root /usr/share/davical/htdocs/;
31 location ~ \.php(|/.*)$ {
32 root /usr/share/davical/htdocs/;
34 include /etc/nginx/conf.d/fastcgi.conf;
35 #if ($request_method = OPTIONS) {
36 # add_header Access-Control-Allow-Credentials "true";
37 # add_header Access-Control-Allow-Headers "User-Agent,Authorization,Content-type,Depth,If-match,If-None-Match,Lock-Token,Timeout,Destination,Overwrite,X-client,X-Requested-With";
38 # add_header Access-Control-Allow-Methods "GET,POST,OPTIONS,PROPFIND,REPORT,PUT,MOVE,DELETE,LOCK,UNLOCK";
39 # add_header Access-Control-Allow-Origin "*";
40 # add_header Content-Length 0;
41 # add_header Content-Type text/plain;
45 if ($request_method !~ ^(GET|HEAD)$) {
46 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
49 if ($no_cache = "1") {
50 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
51 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
52 add_header X-Microcachable "0";
54 if ($http_cookie ~* "_mcnc") {
55 # NOTE: bypass cache if no-cache cookie is set
58 fastcgi_cache_bypass $no_cache;
59 fastcgi_cache_use_stale updating;
60 fastcgi_cache_valid 200 10s;
61 fastcgi_cache_valid 404 10m;
62 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
63 fastcgi_index index.php;
64 fastcgi_param PATH_INFO $fastcgi_path_info;
65 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
66 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
67 fastcgi_no_cache $no_cache;
68 fastcgi_param REDIRECT_STATUS 200;
69 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
70 fastcgi_pass_header Cookie;
71 fastcgi_pass_header Set-Cookie;
72 fastcgi_split_path_info ^(.+\.php)(/.+)$;
74 fastcgi_pass unix:/run/php5/fpm/davical;