0%

nginx对集团内部ip不进行强制跳转https

因产线电脑windows xp不支持访问https缘故,又不能对系统进行升级,故集团内部访问域名不进行强制跳转https,外部访问域名强制跳转https

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.
.
.
省略443配置

server {
listen 80;
server_name xxx.xxx.com;

#location / {
# rewrite ^(.*)$ https://$host$1 permanent;
#}

location / {
if ($remote_addr !~ "10.*"){
return 307 https://$server_name$request_uri;
}
proxy_pass http://logisticscostesign;
}
}