How do I run more than one core application on Nginx server

Posted April 29, 2018 7.3k views
NginxUbuntu 16.04

I want to run two or more core applications on the same server. But the ip and port they use are

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

I found a solition , configration;

public class Program
        public static void Main(string[] args)

        public static IWebHost BuildWebHost(string[] args) =>
                 .UseUrls("http://localhost:5001/")    // We are here to work at a different port

nginx configration

server_name ;
 location / {

                 proxy_pass http://localhost:5001; // Listening 5001 Port
                 proxy_http_version 1.1;
                 proxy_set_header Upgrade $http_upgrade;
                 proxy_set_header Connection keep-alive;
                 proxy_set_header Host $http_host;
                 proxy_cache_bypass $http_upgrade;

                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                # try_files $uri $uri/ =404;

You can wrap them with Docker and configure them to listen different ports.

Read more about that

@mrkemaltas - Please do i need here to use supervisor to make each site always running ?
or just set different port for each app in the program.cs file and set in nginx conf file ?
if yes can you please provide me sample example of conf files ?

thanks a lot …

For each application you need to do broadcasting and listening through separate ports.

  • “For each application you need to do broadcasting and listening through separate ports.”
    How to I do this? Please, anything will help me a lot cause I have to two domain which points to the same contents.