[英]Hosting multiple .net core application on Ubuntu using Nginx
I created sample web api on .net core and registered it on default file in Nginx and was able to access it from outside.我在 .net 内核上创建了示例 web api 并将其注册到 Nginx 中的默认文件中,并且能够从外部访问它。 The API looked like https://<>/api/values.
API 看起来像 https://<>/api/values。 Now I want to add more configurations to host more web api with different port number.
现在我想添加更多配置以托管更多具有不同端口号的 web api。 The problem is how will default file differentiate between multiple APIs since base URL is same ie localhost\<> for all.
问题是默认文件将如何区分多个 API,因为基数 URL 是相同的,即所有的 localhost\<>。
You need to create server blocks.您需要创建服务器块。 Each of these server blocks will handle/listen/respond to different app.
这些服务器块中的每一个都将处理/侦听/响应不同的应用程序。 You can host as many apps you want to on a single Ubuntu machine using nginx this way.
您可以通过这种方式使用 nginx 在一台 Ubuntu 机器上托管任意数量的应用程序。
This will be very helpful and describe the entire process of creating server blocks for your nginx server. 这将非常有帮助,并描述了为您的 nginx 服务器创建服务器块的整个过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.