I have this nginx config for my website on https where nginx is used as a reverse proxy server:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name my_domain123.com www.my_domain123.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name localhost www.my_domain123.com;
return 301 https://my_domain123.com$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name my_domain123.com;
location / {
proxy_redirect http://localhost:4000 https://my_domain123.com;
# ...........................
}
How should I adjust it so that I can host multiple websites with different domain names on the same server? Where in the config exactly should I insert the new configuration for that new website?
Or should I create one more site-available/enabled for it also? Yet, the question remains: how would I combine 2 or more configurations -- same server, multiple domains -- properly?