Good find! I think the two Nginx conf files could likely be the cause.
DNS looks fine, but try removing one Nginx conf:
- SSH in
- remove the non-www conf
- reload nginx
- try loading your site in the browser.
Below is a bunch of speculation about what could be going on due to the presence of the two confs.
Site key determines name for www_root, Nginx conf, and DB
I’m guessing you originally had this:
The above creates the
mydomain.com.conf and a DB named
Then you probably made this change to the “site key”:
The above site key change creates the
In addition, now you have two site directories in your
You would also have two databases due to the different site keys.
Nginx matches only one
server block per
Line 7 in both your nginx confs:
server_name www.mydomain.com; Nginx will only match one or the other
server blocks with identical
server_name directives. Nginx probably matches the
server block in the conf file whose name comes first lexicographically.
mydomain.com.conf comes before
www.mydomain.com.conf alphabetically, so its OLD
server block is probably matched. This block has line 12
root /srv/www/mydomain.com/current/web; so traffic is sent to your OLD deploy’s files where maybe the canonical host and env var was
mydomain.com and WP was perhaps redirecting
If that is the case, any new provision/deploy affects only the NEW site files in
/srv/www/www.mydomain.com but Nginx never sends traffic there.