4 auth_basic "pour demander un compte: admin+vie@cyclocoop.org";
5 auth_basic_user_file /home/www/data/cyclo-wiki/.htpasswd;
6 client_body_buffer_size 8k;
7 client_max_body_size 10m;
8 error_page 404 /cgi/ikiwiki.cgi?do=create&page=$uri;
10 location ~ ^/gitweb/static/.+\.(css|png|js)$ {
16 location ~ ^/gitweb($|/) {
17 root /usr/share/gitweb;
18 fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi;
19 include /etc/nginx/conf.d/fastcgi.conf;
21 if ($request_method !~ ^(GET|HEAD)$) {
22 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
25 if ($no_cache = "1") {
26 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
27 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
28 add_header X-Microcachable "0";
30 if ($http_cookie ~* "_mcnc") {
31 # NOTE: bypass cache if no-cache cookie is set.
34 fastcgi_cache_bypass $no_cache;
35 fastcgi_cache_use_stale updating;
36 fastcgi_cache_valid 200 10s;
37 fastcgi_cache_valid 404 30m;
38 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
39 fastcgi_no_cache $no_cache;
40 fastcgi_param GITWEB_CONFIG /etc/gitweb/cyclo-vie.conf;
41 fastcgi_param PATH_INFO $uri;
43 fastcgi_pass_header Cookie;
44 fastcgi_pass_header Set-Cookie;
45 fastcgi_split_path_info ^(.+\.cgi)(/.+)$;
47 fastcgi_pass unix:/run/spawn-fcgi/gitweb;
50 location /cgi/ikiwiki.cgi {
51 include /etc/nginx/conf.d/fastcgi.conf;
52 fastcgi_index cgi/ikiwiki.cgi;
53 fastcgi_pass unix:/run/spawn-fcgi/cyclo-vie;
55 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {