Domain mapping multisite

Hey All,

I am trying to use the domain mapping plugin to map a domain to a subdomain on a multisite install. The subdomain works great, but as soon as I turn on the actual domain I get “The mywebsite.com page isn’t working. mywebsite.com didn’t send any data. ERR_EMPTY_RESPONSE.” This is hosted on digital ocean. I am pulling my hair out trying to figure out what the issue is but I am totally stumped. I know in the past with cpanel I had to do add the domain to the hosting by parking it. Do I need to do something similar with this nginx trellis set up? Any help would be appreciated.

Which plugin are you using for somain mapping?
Also did you try using CNAME to the subdomain.somaion.com ? Check if you set up the DNS correctly. Usually there is also some documentation in these plugins.

I am using the Wordpress MU domain mapping plugin. I pointed my domain name’s @ record at the IP of my server, which I know is correct. I am just baffled at what to do now because its supposed to “just work”. I dont know how to troubleshoot it.

Ok, so I discovered that for domain mapping to work, your main site needs to be visible at the server’s IP address. Mine is not. Is that how trellis is supposed to be set up or is that a problem with the server configuration somewhere?

The answer to this, in the end was ridiculously easy, but for some reason I overlooked any documentation. For domains that need to be mapped, they need to be added to site_hosts: in wordpress_sites.yml in trellis/group_vars.

2 Likes

Hello @colinob1 ,

The domain should be set inside of redirects: ?

Can you provide a sample wordpress_sites.yml to get an understanding of how you set it up?

Thanks

@rdDragon In group_vars/production/wordpress_sites.yml you add the domains under site_hosts, like so:

wordpress_sites:
  site1.com:
    site_hosts:
      - site1.com
      - site2.com
      - site3.com

I didn’t use redirects, so can’t speak to that.

Thanks @colinob1 I appreciate that

In the DNS records for registrar do you just set the server IP for the wildcard?

*.domain.com - point to IP in DNS?

Thanks

In my sites-enabled profile for my domains I have

server_name {server_ip} domain1.com domain2.com domain3.com;

For the name.com entry I have the nameservers pointing to name.com’s NS but the DNS is pointing:

*.domain1.com - {server_ip} A Record

It doesn’t seem to resolve properly but looking in LeafDNS it shows the A record properly resolving to the IP I have specified so something else must be going wrong.

I’m using wordpress MU domain mapping

In the mapping portion I have:

Site Id: 5 , pointing to domain1.com

Oh cool I ended up getting it working. I had incorrect DNS records placed on registrar side.