0

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.

1 Answers1

1

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):

server {
  listen 443;
  server_name foo.me;
  root /var/www/html;

SSL options left out for simplicity

location / { proxy_pass http://localhost:8433/; } }

server { listen 443; server_name bar.me;

SSL options left out for simplicity

location / { proxy_pass http://localhost:9433/; } }

same for port 80 - hust replace number in "listen" and don't put SSL related directives