NGINX Issues with multiple subdomains

Started by thewolf56, September 24, 2022, 02:00:26 AM

Previous topic - Next topic
Hello,

I used this tutorial (https://forum.opnsense.org/index.php?topic=19305.0) to setup NGINX with Let's Encrypt to setup my initial server.

After reading other items, I ended up using subdomains with subdomain certificates for my Home Assistant and Plex, so the following entries into a web browser work correctly:

No issues with either of those services through mobile browsers or through their respective apps after setting them up correctly.

I tried adding another entry to NGINX for another new server I started for Mealie.  I created a subdomain so that it should connect:
But when I restart NGINX and enter the address into my browser, I get a warning that the website is not safe and once I ignore the safety messages, it takes me to the login screen for home assistant.  Even though the HTTP server is setup with the correct certificate, the website is showing the certificate for hass.mydomain.dns.com instead of the certificate for mealie.mydomain.dns.com.  If I just enter https://mydomain.dns.com into a web browser, it also takes me to the home assistant login screen with a similar certificate issue, even though there is nothing setup in NGINX for that server.  I wonder if it has something to do with sharing the same machine with different ports, but the ports are defined in the Upstream server.

Any help to solve this would be appreciated.