Correction : roundcube : supporte tiny_mce.
[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 /program/js/tiny_mce/ {
37 alias /usr/share/tinymce/www/;
38 }
39 location ~ ^/(bin|SQL)/ {
40 deny all;
41 }
42 location ~ ^/images/.+\.(png) {
43 root /home/www/data/roundcube;
44 access_log off;
45 expires 30d;
46 log_not_found off;
47 }
48 location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
49 root /usr/share/roundcube;
50 access_log off;
51 expires 30d;
52 log_not_found off;
53 }
54 location ~* ^.+\.php(|/.*)$ {
55 root /usr/share/roundcube;
56 include /etc/nginx/conf.d/fastcgi.conf;
57 set $no_cache "0";
58 if ($request_method !~ ^(GET|HEAD)$) {
59 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
60 set $no_cache "1";
61 }
62 if ($no_cache = "1") {
63 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
64 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
65 add_header X-Microcachable "0";
66 }
67 if ($http_cookie ~* "_mcnc") {
68 # NOTE: bypass cache if no-cache cookie is set
69 set $no_cache "1";
70 }
71 fastcgi_cache_bypass $no_cache;
72 fastcgi_cache_use_stale updating;
73 fastcgi_cache_valid 200 10s;
74 fastcgi_cache_valid 404 10m;
75 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
76 fastcgi_index index.php;
77 fastcgi_split_path_info ^(.+\.php)(/.+)$;
78 fastcgi_param PATH_INFO $fastcgi_path_info;
79 fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
80 fastcgi_param RCMAIL_CONFIG_DIR /etc/roundcube;
81 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
82 fastcgi_no_cache $no_cache;
83 fastcgi_param REDIRECT_STATUS 200;
84 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
85 fastcgi_pass_header Cookie;
86 fastcgi_pass_header Set-Cookie;
87
88 fastcgi_pass unix:/run/php5/fpm/roundcube;
89 }
90
91 # vim: ft=sh