0

app.somename.local is not working, but localhost is proxies to app:3000. I want to access to app via typing server_name into browser

worker_processes 1;

events {
  worker_connections 1024;
}

http {
  upstream app {
    server app:3000;
  }

  server {
    server_name app.somename.local;  

    location / {
      proxy_pass http://app/;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header HOST $http_host;
    }
  }
}
  • Possible duplicate of [Access docker container from host using containers name](https://stackoverflow.com/questions/37242217/access-docker-container-from-host-using-containers-name) – Adiii Nov 19 '19 at 06:29
  • You might want to explain your set up a bit more clearly, very hard to understand what you have and what you want. – Don't Panic Nov 19 '19 at 08:35

1 Answers1

0

app.somename.local

Your shooting at wrong target. You need to get that server name resolved. Do this.

    127.0.0.1   app.somename.local >> /etc/hosts

And it should work.