dns - How to set up a simple docker-contained reverse-proxying (nginx) server? -


technically shouldn't asking question able accomplish it, did not record of notes/findings on , forced delete centos vm on not boot properly. fubar , need remember did.

the challange me have 3 different docker containers. npm repo container, bower container (link in comment 1), , controlled nginx container. npm repo , bower had able access same ip address down different ports , accessed via special names bower.swig.swag. or npm.swig.swag. port handling have been taken care of nginx container , in turn have containers desiring accessed @ ip address attach --env flag of virtual_host= (as stated docker info on nginx link).

so ip desired npm containers , bower containers 10.1.10.1 down ports 8080:8080 , 5678:5678 respectively. think dns server 10.1.10.30 or based on localhost, cant sure @ moment ip's try provide, excluding localhost 127.0.0.1 , 10.0.2.15 not work relationship docker run -p flag (i have no idea why happened. 1 minute, ip provide docker works , after deleting it, not. got link error here in comment 2. stupid link rule.) nginx targeted local host if im remembering correctly. down port 80:80.

i cant remember exact flags used, here of possible flags needed run docker. mix of

docker run  -p, --dns=, --env=virtual_host=, -h, --expose 

when specified virtual host container, had modify in vim/vi file of /etc/hosts cant remember how supposed add it. in end, should able take specified virtual host name, go browsers http bar , type, http://virtualhostname , granted access website. thats how knew working. think can me on track? (will posting server fault well. cant balance between site use might well.)

while ip issue remains, (according nmap, of ip's being filtered , have no way fix this.), ive still been able succesfully recreate did on localhost.

the nginx docker information contains information --env=virtual_port=. used work different ports down nginx server. when combined --env=virtual_host=, allows allias bound ip address following port number. typing virtualhost name in url search bar allows link ip , port following it.

in addition specifying in docker run, vim/vi /etc/hosts file must modified contain port , ip address want link aliases to. seems inefficient rather want have docker set containers specifications instead of myself. none less, format of ip's , ports in follows...

ip address   alias1 alias2 alias3 alias4... ::port   aliastoport ::port   2ndaliastoport 

so specific ip address, may accept variety of alias's , can further specified port access specific alias from.

so recap, docker must ran docker run --env=virtual_host=*alias* --env=virtual_port=*port* -p *ip*:*port*:*containerport* *image* container wished ran off docker contained nginx server. , vim/vi file of /etc/hosts must typed

*ip*   *alias* ::*port*   *aliastoport* 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -