Exopse nginx docker to the vpn network without any restrictions

  docker, iptables, networking, nginx

I’m trying to expose my nginx service to the vpn network without any restrictions.

I set up a Nginx docker container with dockerfile as follows:

FROM nginx
COPY ./docs/build/html /usr/share/nginx/html

and then ran docker with:

docker build -t my_image .
docker run --name cnt_name -d -p 8082:80 my_image

While it works pretty well on localhost and I can easily reach my, when I repeat the same steps on remote machine with ip: x.x.xxx.x, and try to access x.x.xxx.x:8082 I’m getting timeout error.

Also when Docker ps I got>80/tcp.

I’m wondering if it has anything to do with iptables_rules but have no idea how to solve it.

I’m new in the topic, so sorry if I’m confusing some concepts.

Source: Docker Questions