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