内网地址为http://IP1:80/wbalone,外网地址为http://IP2:88/wbalone,此时,内外网端口不一致,如果访问外网地址时,输入的为http://IP2:88/wbalone,则会跳转为http://IP2:80/wbalone,此时会如下图
这是因为输入的地址不带/引起的,输入的地址为http://IP2:88/wbalone,此时会默认为wbalone为一个文件,在IP2上寻找这个文件,但是找不到,所以会报这个错误,如果我们访问地址为http://IP2:88/wbalone/,则可以正常访问到。
如果我们想输入http://IP2:88/wbalone,就可以正常访问,那么需要我们在外网的nginx的配置中,做一下rewrite规则,
rewrite ^/([a-zA-Z]+)$ /$1/ permanent;