I want to be able to run two applications using the same port on the same server. My challenge is both applications have a host file that contains the URL it's listening for on port 80. Usually a web server has the ability to create virtual hosts, but I have no idea what I should be doing in this situation (except googling for a solution).
In a production environment you typically want to use a reverse proxy to forward requests to your sites running on Kestrel. You set up your ASP.NET Core applications to run on different ports, i.e. http://example.com:5000 and http://example.com:5001. Then you use IIS, Apache, nginx or similar to act as a reverse proxy. The reverse proxy is listening on port 80 and is forwarding the incoming requests to your Kestrel instances.
Example:
http://example.com/app1 --> http://example.com:5000
http://example.com/app2 --> http://example.com:5001
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With