I'm planning make two websites in same machine. Which first website running on port 8433 and second website running on port 9433
Im using ubuntu 20.04 Assume i have two domains, let's say foo.me and bar.me Both domain is pointed to same public IP and different SSL.
consider there's an incoming request to port 80 or 443
if HTTP header contain foo.me then the request will forward to port 8433
if HTTP header contain bar.me then the request will forward to 9433.
as you have two https sites you need to have two virtual hosts so no need to examine http header again. As in reply pointed by Gerald above the best is to setup it this way (for nginx):
same for port 80 - hust replace number in "listen" and don't put SSL related directives