TL;DR why this wordpress:latest Dockerfile is ok with nginx-proxy but this one not wordpress:fpm Dockerfile ? And how can I use a
wordpress:fpm
image withnginx-proxy
Hi,
I successfully use nginx-proxy with some wordpress container. for example this docker-compose.yml
works perfectly :
db:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=password
volumes:
- /home/stack/my_domain/bdd:/var/lib/mysql
wordpress:
image: wordpress
links:
- db:mysql
environment:
- VIRTUAL_HOST=my_domain.fr,www.my_domain.fr
- LETSENCRYPT_HOST=www.my_domain.fr
- LETSENCRYPT_EMAIL=contact@my_domain.fr
env_file:
- ./env
volumes:
- /home/stack/my_domain/wordpress:/var/www/html
BUT if I use the wordpress:fpm
image (instead of an apache based image) I have 502 Bad Gateway error, and this message in the log:
nginx.1 | 2017/08/14 21:29:51 [error] 347#347: *2447 connect() failed (111: Connection refused) while connecting to upstream, client: 86.222.20.31, server: www.my_domain.fr, request: "GET /contact/ HTTP/2.0", upstream: "http://172.17.0.14:80/contact/", host: "www.my_domain.fr", referrer: "https://www.my_domain.fr/"
and this message :
root@9408854fae4b:/etc/nginx/conf.d# nginx -s reload 2017/08/14 21:37:35 [emerg] 671#671: invalid number of arguments in "upstream" directive in /etc/nginx/conf.d/default.conf:53 nginx: [emerg] invalid number of arguments in "upstream" directive in /etc/nginx/conf.d/default.conf:53
the default.conf at line 53 contains
upstream mydomain.fr {
## Can be connect with "bridge" network
# my_domain_wordpress_1
server 172.17.0.14:9000;
}
other domain have server 172.17.0.xx:80;
so I add port:80
and/or expose:80
in the docker-compose.yml file. I manage to obtain
upstream mydomain.fr {
## Can be connect with "bridge" network
# my_domain_wordpress_1
server 172.17.0.14:80;
}
but with the same 502 error.
Any idea why ?
Regards