nginx转发
1. 根据设备转发到不同的url
location /api/helper/download {
if ($http_user_agent ~* "^(.*iphone.*)$") {
rewrite ^ https://zc.pgyer.com/zfoi redirect;
break;
}
if ($http_user_agent ~* "^(.*android.*)$") {
rewrite ^ https://www.pgyer.com/kg5T redirect;
break;
}
}
2. 转发到内网服务器,内网服务器在防火墙做NAT映射
域名解析到云服务器之后,配置转发到内网出口ip
server {
listen 80;
server_name test.zlt.com;
allow 212.115.148.228;
deny all;
location / {
proxy_pass http://212.115.148.228:65438;
}
}

浙公网安备 33010602011771号