天天看點

nginxhttp轉到https沒有帶端口

nginx https 自動跳轉成http 怎麼解決
您關閉301跳轉,HTTPS自然就無法通路,如果您要HTTPS跳轉HTTP,這個是不正确的行為,如果設定會導緻搜尋引擎蜘蛛混亂,無法确定實際網站,目前搜尋引擎301隻能爬HTTP跳轉HTTPS。
nginx怎麼把http改成https
#配置負載均衡伺服器(采用IPHash算法,相同客戶IP會轉發到相同伺服器)
upstreambackendServermall80
ip_hash;
server192.168.10.91:8080;
server
#設定監聽端口
listen80;
#設定伺服器域名(IP通路和多域名通路可不設定)
#server_name_*;
server_name
www.test.com;
rewrite^(.*$)
​​https://$host$1​​
permanent;
#開啟shtml支援
ssion;
ssi_silent_errorson;
ssi_typestext/shtml;
#設定主通路日志
#access_loglogs/access.logmain;
access_log/dev/null;
error_page404/404.html;
error_page500502503504/50x.html;
#設定轉發到後端伺服器的URL(正規表達式)
#location~(^/(cgi-bin|servlet|chart)/|\.jsp$)
#proxy_pass
#includeproxy.conf;
#設定監控nginx狀态URL
location/__nginxstatus
stub_statuson;
access_logoff;
#全部請求轉發到後端伺服器的設定
location/
proxy_pass
includeproxy.conf;      

繼續閱讀