question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IP down / no binding simple images

See original GitHub issue

Hi,

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:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
r3c4llcommented, May 2, 2018

I find the problem with my conf.

My mistake, I missed an underscore “_” in the VIRTUAL_HOST variable.

Everything working fine for me now.

0reactions
weegercommented, May 15, 2018

Solved. I misunderstood ports usage and did not realize that ports and expose was reserved to a public access, not an internal usage. So I just removed everything and it just works… after days of research.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Port binding issue with nginx reverse proxy #325 - GitHub
I am not able to use NextCloud with a binded port when I use it with ... IP down / no binding simple...
Read more >
Chapter: SIP Binding - Cisco Unified Border Element
When you do not want to specify a bind address or if the interface is down, the IP layer still provides the best...
Read more >
Resolve a Bind Error in Active Directory Authentication
When a user authenticates, Fireware sends two Bind requests to the Active Directory server: one ... If the first Bind fails, the second...
Read more >
docker network create - Docker Documentation
docker network create: Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are the built-in network drivers. If you have installed...
Read more >
3.6. Configuring IP Networking with ip Commands
Configuring IP Networking with ifcfg Files ... ip link set ifname down ... interface it is no longer necessary to use the alias...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found