Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I’m preparing a docker based dev environment for node and nginx but for some reason the nginx pass_proxy is not pointing to the container using their service name.
Here are the configuration files:
default.conf
server {
listen 80;
error_log /var/log/nginx/error.log;
location /api {
proxy_pass http://web:3000;
}
}
nginx Dockerfile
FROM nginx:1.17-alpine
COPY ./default.conf /etc/nginx/conf.d/default.conf
CMD ["/bin/sh", "-c", "exec nginx -g 'daemon off;'"]
docker-compose.yml
version: '3.3'
services:
web:
build: ../backend
container_name: backend
restart: always
volumes:
- ../backend:/usr/src/app
- /usr/src/app/node_modules
ports:
- 6060:3000
server:
build: .
restart: always
container_name: nginx_server
volumes:
- ./log-nginx:/var/log/nginx/
depends_on:
- web
ports:
- 6000:80
I have exposed the web as well and it works when i visit localhost:6060 but if i go to the nginx endpoint by going to this address localhost:6000/api it shows an error page in the browser:
This site can’t be reached
Note that in the default.conf file i have tried using different variations for the pass_proxy container name, for example:
proxy_pass http://web;proxy_pass http://web:3000;proxy_pass web:3000;proxy_pass web;but it seems like non of them are working for nginx to shine. The logs file of nginx are also empty! what I might be missing here? Any help would be really helpful :) One more thing, I am using the alpine based official images.
lwmeozrcbh
d1dd3d9538cc4d06b53e6d1d338d3f
50ff4e4b3c6c4999a12403b1ecda95
a6309a057c3f4cb38fb2e7feb67236
72e571841e7f4a6881090a2f3e93c0
7ce6bf277bff4d429ba493dd750e35
57a72a98162f46a5a5cd04d9b
Thomas Brocken
11575c6d695643cdb40ad47d0f1aea
tez.saad