Today I found myself restarting a docker stack, which is running Nginx Proxy on a HA stack running (3) Linux VM’s.  After restarting the stack, I noticed that one of my WordPress installs wanted to keep redirecting to the install.php file for WordPress.

Typically, you would think this is a wp-config.php or .htaccess file problem, but after digging around for a little bit, i realized that the nginx-gen container had not restarted with the rest of the containers in the jwilder stack.

Simply start up the nginx-gen container, and WordPress will now work properly.

WordPress redirect problem

docker-compose.yml – v3

version: ‘3.3’

services:
db:
image: mariadb:latest
ports:
– 3306
volumes:
– /home/YOU/YOURPROJECT/mariadb:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: *****************
MYSQL_DATABASE: yourdbname
MYSQL_USER: yourdbuser
MYSQL_PASSWORD: yourdbpassword
deploy:
placement:
constraints: [node.role == manager] replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure

phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
– db:mysql
ports:
– 8080:80
volumes:
– /home/YOU/YOURPROJECT/mariadb:/var/lib/mysql
environment:
MYSQL_USER: yourdbuser
MYSQL_PASSWORD: yourdbpassword
MYSQL_ROOT_PASSWORD: ********************
deploy:
placement:
constraints: [node.role == manager] replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
wordpress:
depends_on:
– db
image: wordpress:latest
volumes:
– /home/YOU/YOURPROJECT/wp_core:/var/www/html
– /home/YOU/YOURPROJECT/wp_content:/var/www/html/wp-content

ports:
– 80
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: yourdbuser
WORDPRESS_DB_PASSWORD: yourdbpassword
WORDPRESS_DB_NAME: yourdbname
WORDPRESS_TABLE_PREFIX: wp_
LETSENCRYPT_HOST: yourdomain.com,www.yourdomain.com
LETSENCRYPT_EMAIL: support@yourdomain.com
VIRTUAL_HOST: yourdomain.com,www.yourdomain.com

deploy:
placement:
constraints: [node.role == manager] replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
volumes:
db_data: {}
wp_core: {}
wp_content: {}