crocodile icon indicating copy to clipboard operation
crocodile copied to clipboard

反向代理

Open wangxiaoerYah opened this issue 3 years ago • 3 comments

请问使用nginx反向代理时提示 请求非法是什么原因?


# reverse proxy
location /crocodile/ { 
proxy_pass http://127.0.0.1:5001/crocosdile/;
 include    nginxconfig.io/proxy.conf;
    }

Screenshot_20210623-072048_Chrome~2

修改nginx配置成为这样


# reverse proxy
location / { 
proxy_pass http://127.0.0.1:5001/;
 include    nginxconfig.io/proxy.conf;
    }

可以正常访问。这是什么原因?

wangxiaoerYah avatar Jun 22 '21 23:06 wangxiaoerYah

如果proxy_pass的url不加/crocodile/就会重定向过多


# reverse proxy
location /crocodile/ { 
proxy_pass http://127.0.0.1:5001/;
 include    nginxconfig.io/proxy.conf;
    }

wangxiaoerYah avatar Jun 22 '21 23:06 wangxiaoerYah

求解

wangxiaoerYah avatar Jun 22 '21 23:06 wangxiaoerYah

请问使用nginx反向代理时提示 请求非法是什么原因?


# reverse proxy
location /crocodile/ { 
proxy_pass http://127.0.0.1:5001/crocosdile/;
 include    nginxconfig.io/proxy.conf;
    }

Screenshot_20210623-072048_Chrome~2

修改nginx配置成为这样


# reverse proxy
location / { 
proxy_pass http://127.0.0.1:5001/;
 include    nginxconfig.io/proxy.conf;
    }

可以正常访问。这是什么原因?

解决了吗,大佬,我也有一样的问题。。。

dandyhuang avatar Jul 20 '21 04:07 dandyhuang