Modifications : etc/nginx/site.d/roundcube
[lhc/ateliers.git] / etc / nginx / site.d / roundcube / site.conf
1 server_name
2 roundcube.heureux-cyclage.org
3 roundcube.changedechaine.org
4 roundcube.chatperche.org
5 roundcube.cyclocoop.org
6 roundcube.lesjantesdunord.org
7 roundcube.ptitvelo.net
8 roundcube.veli-velo.org;
9
10 client_body_buffer_size 8k;
11 client_max_body_size 10m;
12
13 location = / {
14 root /usr/share/roundcube;
15 index index.php;
16 }
17 location ~ /\. {
18 access_log off;
19 deny all;
20 log_not_found off;
21 }
22 location = /favicon.ico {
23 root /usr/share/roundcube/skins/default/images/;
24 access_log off;
25 expires max;
26 log_not_found off;
27 }
28 location = /robots.txt {
29 access_log off;
30 allow all;
31 log_not_found off;
32 }
33 location ~ ^/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
34 deny all;
35 }
36 location ~ ^/(bin|SQL)/ {
37 deny all;
38 }
39 location ~ ^/images/.+\.(png) {
40 root /home/www/data/roundcube;
41 access_log off;
42 expires 30d;
43 log_not_found off;
44 }
45 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
46 root /usr/share/roundcube;
47 access_log off;
48 expires 30d;
49 log_not_found off;
50 }
51 location ~* ^.+\.php(|/.*)$ {
52 root /usr/share/roundcube;
53 include /etc/nginx/conf.d/fastcgi.conf;
54 set $no_cache "0";
55 if ($request_method !~ ^(GET|HEAD)$) {
56 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
57 set $no_cache "1";
58 }
59 if ($no_cache = "1") {
60 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
61 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
62 add_header X-Microcachable "0";
63 }
64 if ($http_cookie ~* "_mcnc") {
65 # NOTE: bypass cache if no-cache cookie is set
66 set $no_cache "1";
67 }
68 fastcgi_cache_bypass $no_cache;
69 fastcgi_cache_use_stale updating;
70 fastcgi_cache_valid 200 10s;
71 fastcgi_cache_valid 404 10m;
72 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
73 fastcgi_index index.php;
74 fastcgi_split_path_info ^(.+\.php)(/.+)$;
75 fastcgi_param PATH_INFO $fastcgi_path_info;
76 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
77 fastcgi_param RCMAIL_CONFIG_DIR /etc/roundcube;
78 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
79 fastcgi_no_cache $no_cache;
80 fastcgi_param REDIRECT_STATUS 200;
81 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
82 fastcgi_pass_header Cookie;
83 fastcgi_pass_header Set-Cookie;
84
85 fastcgi_pass unix:/run/php5/fpm/roundcube;
86 }
87
88 # vim: ft=sh