Hey there, I am using a nginx reverse proxy to proxy external requests to internal (non public) services over the railway private network. Everything is working fine until a service, that is proxied to, is redeployed. The proxy response after the redeploy is a 502 Bad Gateway . I tried some suggestions already that where mentioned in this channel but can't seem to get it working. Any help would be appreciated 🙂
This is my simplified nginx.conf:
server {
listen 8080 default backlog=16384;
listen [::]:8080 default backlog=16384;
resolver [fd12::10] valid=10s;
underscores_in_headers on;
server_tokens off;
absolute_redirect off;
location /my-service/ {
proxy_pass http://my-service.railway.internal:8080/;
}
location = / {
default_type text/plain;
add_header content-length "0";
return 200 '';
}
}
Logs before redeploy:
192.168.16.8 - - [18/Oct/2023:14:20:20 +0000] "GET /my-service/ HTTP/1.1" 200 46 "-" "PostmanRuntime/7.33.0" "<my_ip>"
Logs after redeploy:
2023/10/18 15:21:26 [error] 35#35: *1 connect() failed (101: Network is unreachable) while connecting to upstream, client: 192.168.16.8, server: , request: "GET /my-service/ HTTP/1.1", upstream: "http://[fd12:a877:fdc6:0:4000:1:79cf:2751]:8080/", host: "<host_name>"
192.168.16.8 - - [18/Oct/2023:15:21:26 +0000] "GET /my-service/ HTTP/1.1" 502 150 "-" "PostmanRuntime/7.33.0" "<my_ip>"