nginx - Can't access docker over the internet -
i m going crazy trying docker accessible on internet. have created geoserver container on ubuntu 14.04 server using:
sudo docker run -d -p 80:8080 -t eliotjordan/docker-geoserver
but when try connect server through web browser connection times out. know server accessible through domain name because running web site on it, using nginx web server stopped try this.
docker ps
confirms running:
$ sudo docker ps container id image command created status ports names 0e339661c232 eliotjordan/docker-geoserver:latest "/bin/sh -c /opt/tom 4 seconds ago 4 seconds 0.0.0.0:80->8080/tcp sad_morse
and netstat
shows port open:
$ sudo netstat -tulnp active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 127.0.0.1:5432 0.0.0.0:* listen 31023/postgres tcp 0 0 0.0.0.0:25 0.0.0.0:* listen 1047/master tcp 0 0 0.0.0.0:2882 0.0.0.0:* listen 1339/sshd tcp 0 0 127.0.0.1:6379 0.0.0.0:* listen 1067/redis-server 1 tcp6 0 0 ::1:5432 :::* listen 31023/postgres tcp6 0 0 :::25 :::* listen 1047/master tcp6 0 0 :::2882 :::* listen 1339/sshd tcp6 0 0 :::80 :::* listen 16267/docker-proxy udp 0 0 0.0.0.0:60521 0.0.0.0:* 1271/dhclient udp 0 0 0.0.0.0:68 0.0.0.0:* 1271/dhclient udp 0 0 0.0.0.0:161 0.0.0.0:* 1091/snmpd udp6 0 0 :::35967 :::* 1271/dhclient
i notice showing open on ipv6, problem? ufw
disabled , can't think of else check.
i tried proxying through nginx had same result. reference here configuration used:
upstream geoserver_server { server 127.0.0.1:80; # tried 0.0.0.0:80 } server { listen 80; server_name mydomain.com; client_max_body_size 4g; location / { proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header x-forwarded-proto https; proxy_set_header host $http_host; proxy_pass http://geoserver_server; } }
update
here iptables configuration:
$ sudo iptables -t nat -nxvl chain prerouting (policy accept 127 packets, 9452 bytes) pkts bytes target prot opt in out source destination 84453 4816562 docker -- * * 0.0.0.0/0 0.0.0.0/0 addrtype match dst-type local chain input (policy accept 127 packets, 9452 bytes) pkts bytes target prot opt in out source destination chain output (policy accept 99 packets, 7078 bytes) pkts bytes target prot opt in out source destination 0 0 docker -- * * 0.0.0.0/0 !127.0.0.0/8 addrtype match dst-type local chain postrouting (policy accept 99 packets, 7078 bytes) pkts bytes target prot opt in out source destination 0 0 masquerade -- * !docker0 172.17.0.0/16 0.0.0.0/0 chain docker (2 references) pkts bytes target prot opt in out source destination 0 0 dnat tcp -- !docker0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.17.0.32:8080
telnet
connects locally, not external. ditto curl
.
it should not problem see ipv6, server listening ipv4 request too. run netstat , ifconfig in container , post results?
Comments
Post a Comment