1

你好,我正在做学校项目,我安装了配置 nginx 服务器的 ISPConfig,它可以工作,现在我想启用圆形网络邮件。我正在运行 ubuntu,所以我使用了 apt-get

apt-get install roundcube roundcube-plugins roundcube-plugins-extra

该向导为roundcube 配置了我的MySQL 数据库,并将roundcube Web 文件安装到/usr/share/roundcube,在/var/lib/roundcube 中我有指向/usr/share/roundcube 的链接。

现在我需要告诉 nginx,如果有人请求 URL myispconfig.tld/webmail 它打开圆形立方体。但我不确定如何做到这一点,也许是一些别名或创建 vhost ?我可以配置 apache,但我是 nginx 的新手。我阅读了圆形立方体文档,所以我认为我可以处理下一个配置。谢谢

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

location  /webmail/ {
  alias  /usr/share/roundcube/;
}

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

4

1 回答 1

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;
           }

    }

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

于 2013-07-05T01:22:35.357 回答