nginx配置访问1731610198081IOCPCALL时访问1731610198081IOCPCALLindexhtml访问其它页面全都跳转到访问17316101138081上
您可以使用以下配置实现这个需求:
server {
listen 8081;
server_name 173.16.101.9;
location /IOCPCALL/ {
rewrite ^/IOCPCALL/(.*)$ /IOCPCALL/index.html break;
proxy_pass http://173.16.101.9:8081;
}
location / {
return 301 http://173.16.101.13:8081$request_uri;
}
}
这个配置将监听 173.16.101.9 的 8081 端口,并针对 URL 以 /IOCPCALL/ 开头的请求,将其重写为 /IOCPCALL/index.html,并代理到 173.16.101.9 的 8081 端口上。
对于其他请求,将会重定向到 173.16.101.13 的 8081 端口上。
原文地址: https://www.cveoy.top/t/topic/iwys 著作权归作者所有。请勿转载和采集!