IP-based virtual hosts in a container
Mon, 24 Oct 2016 18:34:46 +0200 last edited: Mon, 24 Oct 2016 18:45:59 +0200
I have a Docker container with a nginx reverse proxy with name based virtual hosts and also wanted to have IP-based virtual hosts. But I always got the default server configuration, even I saw in the logs that the correct destination IP was logged, but the listen statements for the ip:port just had no effect.
It seems not to work with the default bridge network. Running the container with --net=host solved this problem and also the IP-based vhosts worked.
It seems not to work with the default bridge network. Running the container with --net=host solved this problem and also the IP-based vhosts worked.
This website is tracked using the Piwik analytics tool. If you do not want that your visits are logged this way you can set a cookie to prevent Piwik from tracking further visits of the site (opt-out).