Nginx proxy to Private Service in same Railway project returns 502 / CORS issues

service
PROOP

17 days ago

I have a project setup where both Nginx and Usermanagement services are running in the same Railway project (fulfilling-encouragement, Production environment). I’m trying to proxy requests from Nginx to Usermanagement, but I keep getting 502 errors and CORS issues. I’m not sure if it’s Nginx, networking, or the ASP.NET service configuration.

Railway project info

  • Project: fulfilling-encouragement

  • Environment: Production

  • Services:

    • Usermanagement

    • prodnginx-multi-app (Nginx)

  • Internal hostname (HR service):

    usermanagement-production.railway.internal

    Template is attached.

    I would be so thanksfull if someone could help me, i am strugling since yesterday.

    BR

1 Replies

service
PROOP

17 days ago

I added addtionaly within nginx.conf health check

health endpoint:

location = /health {

return 200 "ok\n";

add_header Content-Type text/plain always;

}

i invoke nginx public health api by using public endpoint of nginx and adding /health but it returns 502.

It looks like Railway’s proxy can’t reach my container even though it says “Starting container”.

Is there an issue with how Railway expects Nginx to bind to PORT or internal DNS (api.railway.internal)?


Loading...
Nginx proxy to Private Service in same Railway project returns 502 / CORS issues - Railway Help Station