IP down / no binding simple images
See original GitHub issueHi,
I have a lot of problems with images which not use VIRTUAL_PORT properly : odoo, nextcloud, phpmyadmin… This is an example with phpmyadmin, I can access to it by specifying the port http://pma.wex:7040
, but not only http://pma.wex
, so it is not handled by the proxy. What I am doing wrong ?
version: '2.0'
services:
my_mysql:
environment:
MYSQL_PASSWORD:
image: wexample/mysql:latest
networks:
- reverseproxy_wex_net
ports:
- 7030:3306/tcp
restart: always
volumes:
- /var/www/my/mysql/data:/var/lib/mysql:rw
my_phpmyadmin:
environment:
- PMA_HOST=my_mysql
- PMA_PASSWORD=thisIsAReallyNotSecurePassword!
- PMA_USER=root
- VIRTUAL_HOST=pma.wex
- VIRTUAL_PORT='7040'
expose:
- '7040'
image: phpmyadmin/phpmyadmin:4.7.9-1
links:
- my_mysql
networks:
- reverseproxy_wex_net
ports:
- 7040:80/tcp
restart: always
networks:
reverseproxy_wex_net:
external: true
Other simple PHP / Apache images works fine, like this below, I can access to it using http://one.wex
.
version: '2.0'
services:
one_web:
container_name: one_web
environment:
VIRTUAL_HOST: one.wex
VIRTUAL_PORT: '701'
# PHP / APACHE server
image: wexample/php7:latest
networks:
reverseproxy_wex_net: null
ports:
- 701:80/tcp
restart: always
stdin_open: true
tty: true
networks:
reverseproxy_wex_net:
external: true
# pma.wex
upstream pma.wex {
## Can be connect with "reverseproxy_wex_net" network
# pma_my_phpmyadmin_1
server 172.16.238.5 down;
}
server {
server_name pma.wex;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://pma.wex;
}
}
As a fix, I had to make images to use the same port as the VIRTUAL_PORT, which is not easy for every application, and remove the sense to use port binding and proxy.
As a succeed to run a phpmyadmin with a previous version I thought it was a misuse from me, but after the thirt type of really popular images I tried to run, I think there is something uclear we may fix and it drive me crasy 😭
Thank you,
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
I find the problem with my conf.
My mistake, I missed an underscore “_” in the VIRTUAL_HOST variable.
Everything working fine for me now.
Solved. I misunderstood ports usage and did not realize that
ports
andexpose
was reserved to a public access, not an internal usage. So I just removed everything and it just works… after days of research.