V
V
Victor Borisov2017-08-18 12:44:39
Nginx
Victor Borisov, 2017-08-18 12:44:39

How to link docker nginx and two other docker containers running two simple services?

Good afternoon! I'm familiar with Docker and NGINX.
I want to set up proxying through nginx, so that I type test.dev/count_1 in the browser and the service spinning in another container responds to me and is available on my wheelbarrow at 127.0.0.1:8080.
docker run --name count_1 -e ID=1 -p 8080:8080 -d count_ws
docker run --name count_2 -e ID=2 -p 8081:8080 -d count_ws
Accordingly, the second one is available at 127.0.0.1:8180.
How can I do proxy then? =)
When I start a container with nginx, I enter it through the
docker exec -ti my_nginx /bin/bash command
and open its
vim config /etc/nginx/nginx.conf
What settings should I specify for it?
server {
server_name test.dev;
listen 80;
location /count_1 {
proxy_pass ... what to specify here? =) 127.0.0.1:8080 doesn't work
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question