Nginx通过https协议反向代理Confluence 详细配置过程

Tomcat 配置不正确

The Tomcat server.xml 配置不正确:

scheme should be 'https'
proxyName should be 'wiki.xxx.com'
proxyPort should be 'https'

故障排除

1、安装Confluence (百度有很多)

2、Nginx(百度有很多)

3、confluence配置

vim /opt/atlassian/confluence/conf/server.xml
<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"/>

改为

        <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="wiki" proxyPort="443"/>

重启confluence

service confluence restart

4、配置nginx server.conf

vim wiki.xxx.com.conf


upstream wiki.xxx.com{
       server  172.16.84.252:8090;
}    
server {
        #listen       80 ;
        listen 443 ssl;
        server_name wiki.xxx.com;
        ssl_certificate   ssl/4152171.cn.pem;
        ssl_certificate_key  ssl/4152171.cn.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
        ssl_prefer_server_ciphers on;

    location / {
        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://wiki.xxx.com;
    }
    location /synchrony {
        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://wiki.xxx.com/synchrony;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }
server {
       listen       80;
       server_name  wiki.xxx.com;
       rewrite ^ https://$http_host$request_uri? permanent;
}

reload nginx,配置即可

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值