1 server_name caldavzap.heureux-cyclage.org;
3 client_body_buffer_size 1024k;
4 client_max_body_size 10m;
6 location ~* ^/davical/htdocs/caldav.php(|/.*)$ {
9 include /etc/nginx/conf.d/fastcgi.conf;
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.
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";
20 if ($http_cookie ~* "_mcnc") {
21 # NOTE: bypass cache if no-cache cookie is set
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;
40 fastcgi_pass unix:/run/php5/fpm/davical;
42 location ~* ^/davical/htdocs/.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
48 location ~* ^.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
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)(/.+)$;
68 # fastcgi_pass unix:/run/php5/fpm/caldavzap;