[英]How to setup nginx for roundcube in ispconfig server?
您好,我正在學校項目上工作,我安裝了ISPConfig,該服務器配置了nginx服務器,它可以工作,現在我要啟用roundcube webmail。 我正在運行ubuntu,所以我使用apt-get
apt-get install roundcube roundcube-plugins roundcube-plugins-extra
該向導將我的MySQL數據庫配置為roundcube,並將roundcube Web文件安裝到/ usr / share / roundcube,在/ var / lib / roundcube中,我具有到/ usr / share / roundcube的鏈接。
現在,我需要告訴nginx是否有人請求URL myispconfig.tld / webmail來打開roundcube。 但是我不確定如何做到這一點,也許是一些別名或創建vhost? 我可以配置apache,但是我是nginx的新手。 我閱讀了roundcube文檔,因此我認為可以處理下一個配置。 謝謝
編輯:我試圖添加到/etc/nginx/sites-available/ispconfig.vhost
location /webmail/ {
alias /usr/share/roundcube/;
}
但是在nginx重新加載后沒有任何變化:P
解決:squirrelmail作品相同的配置:-)
location /roundcube {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/roundcube/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
# To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) mu$
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
location ~* /.svn/ {
deny all;
}
location ~* /README|INSTALL|LICENSE|SQL|bin|CHANGELOG$ {
deny all;
}
}
注意:Debian用戶應更改“ root / usr / share /;”。 用“ root / var / lib /;” 整個配置文件(共有三個位置)。 否則,他們將得到404錯誤作為whatermark。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.