NGINX Reverse Proxy not working

I am linking docker containers to NGINX container with the following configuration. node1 allowed to write in ** / etc / hosts, you really need to know this part

worker_processes 4;
events { worker_connections 1024; }


http {    

    upstream node_app {
          server node1:8080;
    }

    server {
          listen 80;

          location / {
            proxy_pass http://node_app;
          }
    }
 }

      

When I click http: // {host-machine-ip} I get the correct page I expect, if I change the location / to location / service like below it doesn't work and returns with 404.

worker_processes 4;
events { worker_connections 1024; }


http {    

    upstream node_app {
          server node1:8080;
    }

    server {
          listen 80;

          location /service {
            proxy_pass http://node_app;
          }
    }
 }

      

For more information on installation, I have a related question here

+3


source to share





All Articles