Two Wordpress Dockers on one host issue


To aid development compartmentalisation, I’ve got two separate dockers of Wordpress running (along with two separate MariaDBs dockers also).

Site A in on the host’s IP and binds to port 80
Sita B is on the host’s IP and binds to port 81

Went through with Portainer setting the ENV ports and config within Wordpress settings and confirmed that one site is running on port 80 and the other is on port 81.

For each of Wordpress admin pages for both Site A and B I can connect to those pages successfully.

However if I put in the host address into a browser expecting Site A’s front page on port 80, Site B shows up on port 81.

I seems as I’ve got two webservers running, as soon as Site B hears port 80 traffic is redirects to port 81.

Is there a fix I can do within Portainer / Docker ENVs or is this a CMD line fix involving htaccess somewhere along the line to stop each web server from fighting between itself?



Would suggest to check the wp_options db table, check for site_url and home entries in respective case. mostly this is the root cause of the redirection in case of wordpress. Also you can check wordpress wp_config.php entry for database, usually typos are main culprit.