Corrections : etc/nginx/org/heureux-cyclage/stats/common.conf.m4
[lhc/admin.git] / srv / ateliers / etc / nginx / org / heureux-cyclage / stats / common.conf.m4
1 server_name
2 stats.heureux-cyclage.org;
3 root /home/www/data/org/heureux-cyclage/stats/;
4
5 client_body_buffer_size 8k;
6 client_max_body_size 10m;
7
8 if ($bad_bot) {
9 return 444;
10 }
11 #if ($bad_referer) {
12 # return 444;
13 # }
14
15 #location ~ /\. {
16 # access_log off;
17 # deny all;
18 # log_not_found off;
19 # }
20 location ~* ^.+\.(?:css|gif|jpe?g|js|png|swf)$ {
21 ## Defining the valid referers.
22 ## Disallow any usage of piwik assets if referer is non valid.
23 valid_referers none blocked
24 server_names
25 .changedechaine.org
26 .cyclocoop.org
27 .heureux-cyclage.org
28 .ptitvelo.net
29 .velosenville.org
30 .wiklou.org;
31 if ($invalid_referer) {
32 return 444;
33 }
34
35 expires max;
36 # NOTE: Static files use the OS buffer cache.
37 open_file_cache max=500 inactive=120s;
38 open_file_cache_errors off;
39 open_file_cache_min_uses 2;
40 open_file_cache_valid 45s;
41 tcp_nodelay off;
42 }
43 location = /favicon.ico {
44 ## Support for favicon. Return a 204 (No Content) if the favicon doesn't exist.
45 try_files /favicon.ico =204;
46 }
47 location / {
48 ## Try all locations and relay to index.php as a fallback.
49 try_files $uri /index.php?$query_string;
50 }
51 location ~* ^.+\.php$ {
52 ## Relay all piwik.php requests to fastcgi.
53 include /etc/nginx/conf.d/fastcgi.conf;
54 add_header X-Piwik-Long-Cache $upstream_cache_status;
55 expires epoch;
56 fastcgi_cache microcache;
57 fastcgi_cache_bypass $lhc_stats_no_cache;
58 fastcgi_cache_use_stale error timeout invalid_header updating http_500;
59 fastcgi_cache_valid 200 301 2h;
60 fastcgi_cache_valid 302 30m;
61 fastcgi_cache_valid 404 10m;
62 fastcgi_ignore_headers Cache-Control Expires;
63 fastcgi_no_cache $lhc_stats_no_cache;
64 fastcgi_param REDIRECT_STATUS 200;
65
66 fastcgi_pass unix:CAT(sys/php5/fpm/org/heureux-cyclage/stats/socket);
67 }
68 location ~* (?:DESIGN|(?:gpl|README|LICENSE)[^.]*|LEGALNOTICE)(?:\.txt)*$ {
69 ## Redirect to the root if attempting to access a txt file.
70 return 302 /;
71 }
72 location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
73 ## Disallow access to several helper files.
74 return 404;
75 }
76 location = /robots.txt {
77 ## No crawling of this site for bots that obey robots.txt.
78 return 200 "User-agent: *\nDisallow: /\n";
79 }
80
81 # vim: ft=sh