0

I have created few subdomains for my domain like api.example.com, dev.example.com and www.example.com. For every subdomain i created an virtualhost in Nginx. But now the problem is when i visit a domain which does not exist it should be redirected to www.example.com. But this is not the exist instead i am getting an error page that the sub domain does not have an secure connection. Since i am using Let's Encrypt i get this message all the time for sub domains which is incorrect. I contacted my DNS provider and they told me your settings are correct you have to correct your webserver configuration. They added a CNAME.

Now i do not know how to add this in my nginx configuration. So i hope someone can help me fixing my issue regarding my subdomains.

thanks in advance.

1 Answer 1

0

Here's my best guess based on the very limited information you've provided. If you want a better reply we need to see the Nginx configuration, and it's easier if you can tell us the domain name.

The problem is when you try to visit a site that's not explicitly configured Nginx is serving the default site. This default site's https certificate doesn't match the subdomain you requested, so there's no secure channel.

I'd need to see the Nginx configuration and ideally check the domain to confirm this or tell you much more.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .