如何在ispconfig服务器中为roundcube设置nginx?

Muf*_*lix 0 linux nginx roundcube

您好我正在学校项目,我安装了配置nginx服务器的ISPConfig,它工作,现在我想启用roundcube webmail.我正在运行ubuntu所以我使用了apt-get

apt-get install roundcube roundcube-plugins roundcube-plugins-extra
Run Code Online (Sandbox Code Playgroud)

向导为圆形立方体配置了我的MySQL数据库,并将圆形网络文件安装到/ usr/share/roundcube,在/ var/lib/roundcube中我有到/ usr/share/roundcube的链接.

现在我需要告诉nginx,如果有人请求URL myispconfig.tld/webmail打开roundcube.但我不知道如何做到这一点,也许是别名或创建虚拟主机?我可以配置apache,但我是nginx中的新手.我阅读了圆形文档文档,因此下一步配置我认为我可以处理.谢谢

编辑:我尝试添加到/etc/nginx/sites-available/ispconfig.vhost

location  /webmail/ {
  alias  /usr/share/roundcube/;
}
Run Code Online (Sandbox Code Playgroud)

但在nginx重新加载后没有变化:P

Muf*_*lix 5

求助: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;
           }

    }
Run Code Online (Sandbox Code Playgroud)

注意:Debian用户应该更改"root/usr/share /;" 用"root/var/lib /;" 整个配置文件(有三个地方).否则,他们将得到404错误作为whatermark.

  • 我要注意的是,最好调整`/user/local/ispconfig/server/conf/nginx_apps.vhost.master`或在`/usr/local/ispconfig/server/conf-custom/`中进行自定义配置. 否则您的配置将被覆盖。 (2认同)