公司需要将原http的请求转为https,请问我改如何配置
环境如下
域名 oa.baidu.com
公网IP 220.181.57.217
内网IP(Nginx服务器) 10.250.190.80
Tomcat应用服务器1 10.250.190.81(假设运行应用oa)
Tomcat应用服务器2 10.250.190.82(假设运行应用hr)
现在需要通过域名的4430端口访问各个服务器上的web应用
公网的4430端口已经和内网的10.250.190.80做好映射,证书配置也没问题
我应该如何配置
https://oa.baidu.com:4430/oa/
https://oa.baidu.com:4430/hr/
以下是我配置的,
server {
listen 443;
charset utf-8;
proxy_redirect off;
server_name oa.baidu.com;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/oa_baidu_com.pem;
ssl_certificate_key cert/oa_baidu.com.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location ^~ /oa/ {
proxy_pass http://10.250.190.81:8080/oa/;
proxy_set_header Host $http_host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header User-Agent;
}
}
配置好后重启nginx服务器后,访问https://oa.baidu.com:4430/oa/,报错如下
但地址发生了变化,http://oa.baidu.com:443/oa/login
我发现https变成了http,4430端口也变成了443端口,不知道哪里设置错了,请求帮助,感激不尽