步骤1:设置context 二级目录
如果您想在没有context路径(www.example.com)的情况下访问Confluence,或者通过子域(Confluence.example.com)访问Confluence,请跳过此步骤。
通过下面设置可以实现 http://example:8090/conference 即可访问
在Tomcat中设置confluence应用程序路径(主机名和端口之后的部分)。编辑<安装目录>/conf/server.xml
,找到“上下文”定义:
<Context path="" docBase="../confluence" debug="0" reloadable="false">
并将其更改为:
<Context path="/confluence" docBase="../confluence" debug="0" reloadable="false">
重新启动Confluence,并检查您是否可以在http://example:8090/conference
步骤2:配置Tomcat连接器
同样的<安装目录>conf/server.xml
文件中,使用示例连接器作为起点
注释掉默认连接器(用于未经处理的访问)
如果配置
HTTPS-通过Apache或Nginx通过HTTPS进行代理聚合标题
插入您的代理名称以及代理端口如下最后一行所示:
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" minSpareThreads="10"
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https" secure="true" proxyName="www.example.com" proxyPort="443"/>
请确保包含的值正确协议
以及代理名称
.
如果是http访问请如下配置
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
maxThreads="48" minSpareThreads="10"
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`"<>" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="http" proxyName="www.example.com" proxyPort="80"/>
第三步:配置NGINX
您需要在NGINX中指定一个监听服务器,如下例所示。将以下内容添加到NGINX配置中。
替换服务器名称以及SSL证书和密钥的位置
在本例中,用户将直接连接到Synchrony,这是协作编辑所必需的。
server {
listen www.example.com:80;
server_name www.example.com;
listen 443 default ssl;
ssl_certificate /usr/local/etc/nginx/ssl/nginx.crt;
ssl_certificate_key /usr/local/etc/nginx/ssl/nginx.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-
POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:
ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-
AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-
AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-
ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-
RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-
SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-
SHA:!DSS';
ssl_prefer_server_ciphers on;
location /confluence {
client_max_body_size 100m;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8090/confluence;
}
location /synchrony {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8091/synchrony;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}