I want to use a dockerized SQL database server, an additional client (here: phpmyadmin) and a reverse proxy to make the client interface reachable from outside servers.
So far I used this docker-compose file:
version: '3'
services:
mariatest:
image: mysql
restart: always
networks:
- dbnet
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: test
phpmatest:
depends_on:
- mariatest
image: phpmyadmin/phpmyadmin
restart: always
networks:
- dbnet
ports:
- "9080:80"
environment:
MYSQL_ROOT_PASSWORD: password
PMA_HOST: mariatest
reverse:
image: nginx
networks:
- dbnet
ports:
- "8000:80"
volumes:
- /var/dockervolumes/nginx:/etc/nginx
networks:
dbnet:
The taken from the volume I get the nginx default.conf file as
server {
listen 80;
server_name localhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://localhost:9080/;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
When using the local machine with http://localhost:9080 I can use the PMA without any problems. When trying to use the reverse proxy address (http://localhost:8000) I only get an nginx error the page I am looking for is unavailable. Inside the logs I see that the reverse proxy fails on the connect() with connection refused.
What am I missing for such setups?