ng 能把https转发成http吗

我请讲解下,ng 能把https转发成http吗
最新回答
听海的哭泣ぃ

2021-03-21 10:53:25

#配置负载均衡服务器(采用IP Hash算法,相同客户IP会转发到相同服务器)
upstream backendServermall80
{
ip_hash;
server 192.168.10.91:8080;
}

server
{
#设置监听端口
listen 80;

#设置服务器域名(IP访问和多域名访问可不设置)
#server_name _*;
server_name
www.test.com;

rewrite ^(.*$)
https://$host$1
permanent;

#开启shtml支持
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;

#设置主访问日志
#access_log logs/access.log main;
access_log /dev/null;

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;

#设置转发到后端服务器的URL(正则表达式)
#location ~ (^/(cgi-bin|servlet|chart)/|\.jsp$)
#{
# proxy_pass
http://backendServerhx;

# include proxy.conf;
# }

#设置监控nginx状态URL
location /__nginxstatus
{
stub_status on;
access_log off;
}

#全部请求转发到后端服务器的设置
location /
{
proxy_pass
http://backendServermall80;

include proxy.conf;
}

}
夙词欢

2022-05-11 07:50:59

关掉https就行了,浏览器都是默认http的。
oО绿帽侠

2021-03-03 11:09:00

ejejejeeej