+-
Nginx.如果为空URI.如果为空域.位置.正则表达式
我正在使用上游模块来平衡我的网站.由于某种原因,我不得不将一些请求重定向到指定的服务器.
简而言之:我想将domain.com重定向到指定的服务器,domain.com / anything可以由上游模块提供.因此,如果请求中仅存在域,而没有其他域.

   location [here_something_i_dont_know]/ {
        proxy_pass           http://0.0.0.0:9000/;
        access_log      off;
    }

感谢您的帮助!

最佳答案
   location = / {
        proxy_pass           http://0.0.0.0:9000/;
        access_log      off;
   }
   location / {
        proxy_pass           http://another_upstream;
        access_log      off;
   }
点击查看更多相关文章

转载注明原文:Nginx.如果为空URI.如果为空域.位置.正则表达式 - 乐贴网