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