0

I have a Dockerized Nginx Proxy that sits on my server.

One of my sites is a Docker-Compose Wordpress site. They are separate container and must remain that way.

When I update my Site Url in the Settings I can still log into my Admin Dashboard, but I cannot reach my actual site. I receive a 502 Gateway Error from Nginx.

Nginx Server Block:

   server{

        listen 80;
        server_name test.com;
        client_max_body_size 2M;
        location / {
          proxy_pass http://XXX.XXX.XXX.XXX:8001;
        }
   } 

Wordpress docker-compose.yml:

version: '2'
services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: password
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: password

   wordpress:
     depends_on:
       - db
     build: ./wordpress
     ports:
       - "8001:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_PASSWORD: password
     volumes: 
       - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini 
       - ./php.ini:/usr/local/etc/php/conf.d/php.ini 
volumes:
    db_data:

1 Answer 1

0

Your docker container is binding port 80 to 8185 and your nginx proxy is pointing at port 8001 when it should be pointing at 8185.

1
  • that was a typo in moving everything on to stackoverflow. they are bound to the same ports. if that was the problem i wouldn't be able to hit my site at all. i am able to hit the admin dashboard but nothing else. Oct 5, 2017 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.