I am pretty sure this has already been answered elsewhere, however I do not really understand the solutions. Basically I have 2 websites running inside my network, and I want to have 2 different domains point to these websites, both of which i would like to be https. I was thinking of hosting them on 2 different ports, but i am not really sure how to do this on https.
2 Answers
Downvoting of those kind of comments makes SO so hard for entry level programmers.

- 190
- 2
- 13
You cannot host two different websites/servers on the same port because they would conflict. As two cannot run on the same port. So you need to host two servers on two different ports. This does not mean you need two machines. Only one machine which two ports/hosts running.
To connect these two servers and host a website with HTTPS. You need to allow cors on both ports. This will allow you to connect the two sites. (bridge data).
To make HTTPS available o both websites you need to self-sign a certificate or buy a certificate. You will need two certificates signed if you need two websites running on different ports.
For more information to get a self signed certificate.
Refer: How to generate a self-signed SSL certificate using OpenSSL?

- 347
- 2
- 10
-
Hope this was a helpful explaination. – Dinuda Yaggahavita Aug 15 '21 at 14:53
-
No problem Sam. Make sure you verify this answer as correct so others can trust this answer too. helps the community. – Dinuda Yaggahavita Aug 15 '21 at 14:57