2 years ago
I have 4 services the fourth one is nginx reverse-proxy.
Two services are dockerized, the other service is straight nodejs.
Now the NodeJs works well, I call the service name with a port number, but calling the other two dockerized fail. I tried entering the whole DNS api.railway.internal but it doesn't work.
What should I do?
I am using NGINX, so here is basic config I want to achieve
upstream api_service {
server api.railway.internal:5000 fail_timeout=120;
}Then I can use it in a location block
location /api {
proxy_pass http://api_service
}5 Replies
2 years ago
nginx is hard to do correctly with the private network, instead I recommend using caddy, here's a template that likely does what you want -
When sending requests to this api.example.com/v1 I want this to proxy to api.railway.internal:3000/api/v1
api.example.com/v1/groove
I want this to proxy to groove.railway.internal:5000/api/v1
Am try caddy but am totally new to so my config is messed up, nothing is working
2 years ago
show me your caddyfile please