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

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

location / {

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

}
原文地址:https://www.cnblogs.com/jackzhuo/p/13880007.html