nginx 配置如果访问的内容不存在,则转发请求

在nginx.conf中配置修改,添加这一行代码就可以了。

location / {

   //前面代码都正常
  if (!-e $request_filename){
       proxy_pass http://127.0.0.1
    }

}

 

posted @ 2020-10-26 18:24  离岸少年  阅读(780)  评论(0编辑  收藏  举报