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
28 if ($invalid_referer) {
33 # NOTE: Static files use the OS buffer cache.
34 open_file_cache max=500 inactive=120s;
35 open_file_cache_errors off;
36 open_file_cache_min_uses 2;
37 open_file_cache_valid 45s;
40 location = /favicon.ico {
41 ## Support for favicon. Return a 204 (No Content) if the favicon doesn't exist.
42 try_files /favicon.ico =204;
45 ## Try all locations and relay to index.php as a fallback.
46 try_files $uri /index.php?$query_string;
48 location = /piwik.php {
49 ## Relay all piwik.php requests to fastcgi.
50 include /etc/nginx/conf.d/fastcgi.conf;
51 add_header X-Piwik-Long-Cache $upstream_cache_status;
53 fastcgi_cache microcache;
54 fastcgi_cache_bypass $lhc_stats_no_cache;
55 fastcgi_cache_use_stale error timeout invalid_header updating http_500;
56 fastcgi_cache_valid 200 301 2h;
57 fastcgi_cache_valid 302 30m;
58 fastcgi_cache_valid 404 10m;
59 fastcgi_ignore_headers Cache-Control Expires;
60 fastcgi_no_cache $lhc_stats_no_cache;
61 fastcgi_param REDIRECT_STATUS 200;
63 fastcgi_pass php_fpm_lhc_stats;
65 location ~* ^.+\.php$ {
66 ## Any other attempt to access PHP files redirects to the root.
69 location ~* (?:DESIGN|(?:gpl|README|LICENSE)[^.]*|LEGALNOTICE)(?:\.txt)*$ {
70 ## Redirect to the root if attempting to access a txt file.
73 location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
74 ## Disallow access to several helper files.
77 location = /robots.txt {
78 ## No crawling of this site for bots that obey robots.txt.
79 return 200 "User-agent: *\nDisallow: /\n";