Service responds internally but Railway proxy shows "connection refused"
frandesarrolladorweb
FREEOP

2 months ago

Deployment Details:

- Project: TripPlanner

- Latest Deployment ID: 6523bee2-819c-4254-94f5-0d80b97de905

- Error: Railway proxy shows "connection refused" but app works internally

- Region: europe-west4-drams3a

Evidence:

1. Application responds successfully internally:

- Internal curl test: HTTP 200 OK

- Nginx access logs: "GET /index.php" 200

2. Services listening correctly:

- Nginx: tcp 0.0.0.0:8080 LISTEN

- PHP-FPM: tcp 127.0.0.1:9000 LISTEN

3. All configurations verified:

- Nginx config syntax: OK

- PHP-FPM config: OK

- PORT environment variable: 8080

4. Railway proxy error:

- upstreamErrors: "connection refused"

- upstreamAddress: "" (empty)

- This suggests Railway edge cannot establish TCP connection

Solved$10 Bounty

6 Replies

2 months ago

Hmmm could I get a bit more info on this? I don't see much indicating failures and all looks to be connected


Status changed to Awaiting User Response Railway about 2 months ago


frandesarrolladorweb
FREEOP

2 months ago

I am exactly looking for the same, when I go to the Log Explorer I just see an error like this with no more information. Can you help me a bit to find more visibility ?

Thanks for the help

Attachments


Status changed to Awaiting Railway Response Railway about 2 months ago


darseen
HOBBYTop 5% Contributor

2 months ago

The issue is most likely caused by missing IPv6 Binding. Your Nginx is likely only listening on IPv4 (0.0.0.0), but Railway's internal network often attempts to connect via IPv6. tcp 0.0.0.0:8080 LISTEN confirms your application is listening on IPv4 only.

You should update your Nginx server block to include the IPv6 listener.
Add this line for IPv6: listen [::]:8080;

server {
listen 8080;
listen [::]:8080;
}


darseen

The issue is most likely caused by missing IPv6 Binding. Your Nginx is likely only listening on IPv4 (0.0.0.0), but Railway's internal network often attempts to connect via IPv6. tcp 0.0.0.0:8080 LISTEN confirms your application is listening on IPv4 only.You should update your Nginx server block to include the IPv6 listener.Add this line for IPv6: listen [::]:8080;server { listen 8080; listen [::]:8080; }

2 months ago

The public HTTPS proxy connects to the application via IPv4, not IPv6.


brody

The public HTTPS proxy connects to the application via IPv4, not IPv6.

darseen
HOBBYTop 5% Contributor

2 months ago

Thanks brody. It's just a suggested fix, and I was talking about internal network (I know the issue is most likely not related to it). But nonetheless, looking at it again, it seems a bit far fetched. I only suggested it because a lot of IPv4 only bindings cause network issues.

The only thing I can think of right now, is that it might be a port mismatch. Although, the image provided by OP is not actually an error, as it shows a 200 ok status. Which might mean that Nginx is writing to stderr for some reason.


frandesarrolladorweb
FREEOP

2 months ago

Thanks darseen and brody for the help ! I tried to add connection via IPv6 for the internal servers and it worked. I was stucked for 2 days on this thank you so much


Status changed to Solved frandesarrolladorweb about 2 months ago


Loading...