简体   繁体   English

Nginx 是否具有等效于 IIS 的虚拟应用程序?

[英]Does Nginx have an equivalent of IIS Virtual apps?

In IIS you can host multiple web applications under one site, eg example.com/{application1} and have example.com/{application2} is there any equivalent on Nginx (or any Linux based web server) where you can do something similar? In IIS you can host multiple web applications under one site, eg example.com/{application1} and have example.com/{application2} is there any equivalent on Nginx (or any Linux based web server) where you can do something similar?

Of course, there is location syntax where you can declare the rules on how to process different URIs, for example当然,还有location语法,您可以在其中声明如何处理不同 URI 的规则,例如

server example.com;
location /app1 {
    # config for application 1 (served under example.com/app1 prefix)
}
location /app2 {
    # config for application 2 (served under example.com/app2 prefix)
}

Locations can be declared using regex matching rules.可以使用正则表达式匹配规则声明位置。 You can serve files from different directories, proxy requests to different backends etc.您可以为来自不同目录的文件、对不同后端的代理请求等提供服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM