Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This questionThis question has sample nginx file related to your use case (although, not related to containers).

Edit : To map the node app with the nginx, you first need to link the node container with nginx container.

docker run -d -p 80:80 --name "nginx" --link nodejs:nodejs localhost:5000/test/nginx:1

When you link the node container with the nginx container, the node container's address will be saved in the /etc/hosts. So the nginx container can access the node's address from there.

So, in nginx configuration file, the nodejs will be accessible as nodejs' container address:

http {

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        }
         
        server {
              listen 80;
         
              location / {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
              }
        }
}

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

Edit : To map the node app with the nginx, you first need to link the node container with nginx container.

docker run -d -p 80:80 --name "nginx" --link nodejs:nodejs localhost:5000/test/nginx:1

When you link the node container with the nginx container, the node container's address will be saved in the /etc/hosts. So the nginx container can access the node's address from there.

So, in nginx configuration file, the nodejs will be accessible as nodejs' container address:

http {

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        }
         
        server {
              listen 80;
         
              location / {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
              }
        }
}

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

Edit : To map the node app with the nginx, you first need to link the node container with nginx container.

docker run -d -p 80:80 --name "nginx" --link nodejs:nodejs localhost:5000/test/nginx:1

When you link the node container with the nginx container, the node container's address will be saved in the /etc/hosts. So the nginx container can access the node's address from there.

So, in nginx configuration file, the nodejs will be accessible as nodejs' container address:

http {

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        }
         
        server {
              listen 80;
         
              location / {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
              }
        }
}
added 1123 characters in body
Source Link
manish
  • 996
  • 2
  • 12
  • 35

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

Edit : To map the node app with the nginx, you first need to link the node container with nginx container.

docker run -d -p 80:80 --name "nginx" --link nodejs:nodejs localhost:5000/test/nginx:1

When you link the node container with the nginx container, the node container's address will be saved in the /etc/hosts. So the nginx container can access the node's address from there.

So, in nginx configuration file, the nodejs will be accessible as nodejs' container address:

http {

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        }
         
        server {
              listen 80;
         
              location / {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
              }
        }
}

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

Edit : To map the node app with the nginx, you first need to link the node container with nginx container.

docker run -d -p 80:80 --name "nginx" --link nodejs:nodejs localhost:5000/test/nginx:1

When you link the node container with the nginx container, the node container's address will be saved in the /etc/hosts. So the nginx container can access the node's address from there.

So, in nginx configuration file, the nodejs will be accessible as nodejs' container address:

http {

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        }
         
        server {
              listen 80;
         
              location / {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
              }
        }
}
added 291 characters in body
Source Link
manish
  • 996
  • 2
  • 12
  • 35

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

You need to expose the port of the node.js container to which nginx(angular) container will connect. See the Connect using network port mapping section of docker documentation.

Update : I think, you need to configure the nginx configuration file to the node container. This question has sample nginx file related to your use case (although, not related to containers).

improve link to bring the user to the right section
Source Link
Thomasleveil
  • 105.1k
  • 18
  • 123
  • 119
Loading
Source Link
manish
  • 996
  • 2
  • 12
  • 35
Loading