1 server_name stats.heureux-cyclage.org;
3 client_body_buffer_size 8k;
4 client_max_body_size 10m;
18 location ~* ^.+\.(?:css|gif|jpe?g|js|png|swf)$ {
19 ## Defining the valid referers.
20 ## Disallow any usage of piwik assets if referer is non valid.
21 valid_referers none blocked
26 if ($invalid_referer) {
31 # NOTE: Static files use the OS buffer cache.
32 open_file_cache max=500 inactive=120s;
33 open_file_cache_errors off;
34 open_file_cache_min_uses 2;
35 open_file_cache_valid 45s;
38 location = /favicon.ico {
39 ## Support for favicon. Return a 204 (No Content) if the favicon doesn't exist.
40 try_files /favicon.ico =204;
43 ## Try all locations and relay to index.php as a fallback.
44 try_files $uri /index.php?$query_string;
46 location = /piwik.php {
47 ## Relay all piwik.php requests to fastcgi.
48 include /etc/nginx/conf.d/fastcgi.conf;
49 add_header X-Piwik-Long-Cache $upstream_cache_status;
51 fastcgi_cache microcache;
52 fastcgi_cache_bypass $no_cache;
53 fastcgi_cache_use_stale error timeout invalid_header updating http_500;
54 fastcgi_cache_valid 200 301 2h;
55 fastcgi_cache_valid 302 30m;
56 fastcgi_cache_valid 404 10m;
57 fastcgi_ignore_headers Cache-Control Expires;
58 fastcgi_no_cache $no_cache;
59 fastcgi_param REDIRECT_STATUS 200;
61 fastcgi_pass php5_fpm_lhc_stats;
63 location ~* ^.+\.php$ {
64 ## Any other attempt to access PHP files redirects to the root.
67 location ~* (?:DESIGN|(?:gpl|README|LICENSE)[^.]*|LEGALNOTICE)(?:\.txt)*$ {
68 ## Redirect to the root if attempting to access a txt file.
71 location ~* \.(?:bat|html?|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
72 ## Disallow access to several helper files.
75 location = /robots.txt {
76 ## No crawling of this site for bots that obey robots.txt.
77 return 200 "User-agent: *\nDisallow: /\n";