为了账号安全,请及时绑定邮箱和手机立即绑定

nginx配置后,访问不到后端,报404

nginx配置:

server{
   listen 80;
      server_name wj.com;
   location /{
        proxy_pass http://localhost:8080/;
       
        add_header Access-Control-Allow-Origin $http_origin;
        add_header Access-Control-Allow-Methods *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Allow-Credentials true;
        add_header Access-Control-Allow-Headers $http_access_control_request_headers;
       
        if ($request_method = OPTIONS){
         return 200;
        }
      }
   }

client:

var base = "http://wj.com/test";

nginx重载过。

https://img1.sycdn.imooc.com//5bf8c8150001f5e309480298.jpg

https://img1.sycdn.imooc.com//5bf8c8af00015b4b07090101.jpg

https://img1.sycdn.imooc.com//5bf8c8c5000174ae03950312.jpg




正在回答

3 回答

b.com:8888/test/get1

b.com:8888/test/get1

b.com后面加配置的监听端口号


0 回复 有任何疑惑可以回复我~

同样的问题,楼主解决了吗 呜呜

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

nginx配置后,访问不到后端,报404

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信