简体   繁体   English

使用 Nginx 在 Ubuntu 上托管多个 .net 核心应用程序

[英]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.

相关问题 在 unbuntu 和 nginx 上托管多个 ASP NET Core 站点作为反向代理 - Hosting multiple ASP NET Core sites on unbuntu and nginx as reverse proxy 在共享Linux主机上托管ASP.NET Core应用程序 - Hosting ASP.NET Core application on shared Linux hosting 如何使用 Nginx 服务器在 Ubuntu 服务器上部署 dotnet 核心应用程序? - How to deploy dotnet core application on Ubuntu server with Nginx server? 如何在使用 .NET 核心应用程序时获得 Ubuntu 的总 CPU 百分比和内存百分比使用率 - How to get total CPU % and Memory% usage on Ubuntu in using .NET core application 在 Ubuntu 上运行独立的 ASP.NET Core 应用程序 - Running a self-contained ASP.NET Core application on Ubuntu ASP.NET Core Angular应用程序无法在具有Nginx和Systemd的Ubuntu 16.04上运行 - ASP.NET Core Angular app fails to run on Ubuntu 16.04 with Nginx and Systemd asp.net core 3.0 上的 502 Bad Gateway 托管在 ubuntu 18.04 TLS 和 nginx 中 - 502 Bad Gateway on asp.net core 3.0 hosted in ubuntu 18.04 TLS with nginx 如何在 hostgator linux 共享主机上安装 ASP.NET Core 应用程序? - How can I install ASP.NET Core application on a hostgator linux shared hosting? Apache2:托管多个站点(Ubuntu 服务器 - Apache2: Hosting Multiple Sites (Ubuntu Server 如何在不使用sudo的情况下在Ubuntu上安装.Net Core? - How do you install .Net Core on Ubuntu without using sudo?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM