简体   繁体   中英

How to run Multiple Servers as one without using different ports for each?

I have multiple ASP.NET servers which run on the same IP address but different ports. They run in Microsoft IIS and together make a multi-tenant application. Examples of these servers are shown in the table below. There are more than 15 servers. Since there are many ports open, it raises a security concern that the application is vulnerable to attacks.

+------------+-----------+----------------+-----------------+-----------+
| Server     |    Home   | Authentication | User Management |   Others  |
+------------+-----------+----------------+-----------------+-----------+
| IP Address | 127.0.0.1 |    127.0.0.1   |    127.0.0.1    | 127.0.0.1 |
+------------+-----------+----------------+-----------------+-----------+
| Port       |     80    |       97       |       120       |           |
+------------+-----------+----------------+-----------------+-----------+

At this application, you can access the homepage on port 80, and when you click the login button, the Home server redirects you to the Authentication server on port 97. Although it is easier to manage separate server projects, it's not good for production.

Can you suggest your solution, what architecture I should use instead of the multi-ports issue?

You can uniquely ID servers not only by the IP and port but also by its name .

I suggest you use the hosts file locally or a DNS server.
For example on your hosts file you can have:

127.0.0.1 home.lan
127.0.0.1 users.lan

Either run on port 80, you can browse
http://home.lan to reach the home server or http://users.lan to reach the user's server.

On-Premises (PROD) environment or cloud you must setup your DNS

Your question does not describe how your solution is used: local DMZ? Azure? AWS?

Other possible solutions can be:

  • Docker with or without Nginx .
  • nginx in your local environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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