Cannot configure nginx proxy pass to internal service

mikhailHOBBY

a year ago

I've created this nginx config:

http {
  server {
    server_name localhost;

    listen 80;
    listen [::]:80;

    location /accounts {
      proxy_pass http://ellsworld-accounts.railway.internal;
    }
  }
}

Also tried with port proxy_pass [http://ellsworld-accounts.railway.internal:3000](http://ellsworld-accounts.railway.internal:3000);.

But I have errors in logs: host not found in upstream "ellsworld-accounts.railway.internal".

Nginx should see this service in private network but I think it is something with DNS. I use official Docker image.

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

2 Replies

mikhailHOBBY

a year ago

I used Caddyfile instead of Nginx and it helped. So it is not with DNS and I'm just not good with nginx I think. I'll be glad for any advice how to make it work with Nginx.


a year ago

There are just far too many caveats with using nginx as a reverse proxy in the private network environment that I just cant recommend you use it in this context.