NGINX Reverse Proxy not handling domains with Dashes

Viewed 348

Running Ubuntu 18.04 and nginx 1.17.8

Running multiple docker containers and nginx in a container to host multiple sites.
Everything is working fine for about half of the sites, the half without dashes in the domain names.

domain.com - proxies fine

my-domain.com - never matches and fails

I have several files as such in /etc/nginx/conf.d/sites-available, 1 for each domain.
each one looks like this.

server {
  listen        80;
  server_name   www.domainname.com domainname.com;

  location / {
    proxy_pass  http://containername;
    proxy_set_header Host www.domainname.com;
  }
}

The sites that have dashes in the domain, ex: this-is-my-domain.com, all go to the default site, as they never match.

I have already changed (per hours of googling ):
server_names_hash_bucket_size 128;

0 Answers
Related