更新war包后,一个页面跳转的时候报the plain http request was sent to https port,大家帮忙看看该怎么解决。
服务器ip:192.168.11.193
nginx配置:
....
upstream server {
ip_hash;
server 127.0.0.1:8080 fail_timeout=5s;
}
server {
listen 8443;
server_name localhost;
ssl on;
ssl_certificate /root/keys/XXX.crt;
ssl_certificate_key /root/keys/XXX.pem;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
proxy_pass http://server/;
}
.....
nginx访问日志:
192.168.11.193 - - [12/Jan/2015:18:27:03 +0800] "POST /cms/content/save HTTP/1.1" 302 0 "https://192.168.11.193:8443/cms/content/singleton/3001?treeid=treeMenu_6&categorycode=3001" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "-"
192.168.11.193 - - [12/Jan/2015:18:27:03 +0800] "GET /cms/content/singleton/3001?treeid=treeMenu_6&categorycode=3001 HTTP/1.1" 400 666 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "-"
请求详情:
Remote Address:192.168.11.193:8443
Request URL:https://192.168.11.193:8443/cms/content/save
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:zh-CN,zh;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:532
Content-Type:application/x-www-form-urlencoded
Cookie:JSESSIONID=1782F34E31E4FD2DD6F08EFB97069FAA
Host:192.168.11.193:8443
Origin:https://192.168.11.193:8443
Referer:https://192.168.11.193:8443/cms/content/singleton/3001?treeid=treeMenu_6&categorycode=3001
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Form Dataview sourceview URL encoded
title:帮助中心
content:<p><img src="/../upload/ueditor/image/20150112/1421035252889034863.jpg" title="1421035252889034863.jpg" alt="tumblr_lhwtpsu8yj1qcxjs1o1_500.jpg"/></p>
treeid:treeMenu_6
singleton:1
currentPage:
pageSize:
id:1
categorycode:3001
editorValue:<p><img src="/../upload/ueditor/image/20150112/1421035252889034863.jpg" title="1421035252889034863.jpg" alt="tumblr_lhwtpsu8yj1qcxjs1o1_500.jpg"/></p>
Response Headersview source
Connection:keep-alive
Content-Language:zh-CN
Content-Length:0
Date:Mon, 12 Jan 2015 10:30:35 GMT
Location:http://192.168.11.193:8443/cms/content/singleton/3001?treeid=treeMenu_6&categorycode=3001
Server:nginx
你8443端口是https端口,你发送了http数据请求
http://www.2cto.com/os/201207/140237.html
纯http请求发送到了https端口上
http://zhainan.org/post-1823.html
http://www.2cto.com/os/201207/140237.html
http://www.baidu.com/link?url=pCzTGG96GvGUKyRd86XxaUvDIZX55REoY4a-a6vW1LwKEtD8F7twzArVhDl5K10Lgb2a8dMa3pm9bp73Xmu7o_
把你的访问url前面改成https://就行了。