ng 能把https转发成http吗

2025-02-23 18:07:56
推荐回答(3个)
回答1:

#配置负载均衡服务器(采用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;
}

}

回答2:

关掉https就行了,浏览器都是默认http的。

回答3:

ejejejeeej