2 months ago
Hi, @brody,
I have a problem while setting up nginx proxy manager.
I deployed proxy and get the following error.
100.64.0.2 - - [23/May/2025:00:02:41 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" "45.58.143.214"
2025/05/23 00:02:41 [error] 23#23: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 100.64.0.2, server: app-server, request: "GET / HTTP/1.1", upstream: "http://[fd12:6a89:ec02::66:da68:8a52]:5173/", host: "pacific-nurturing-staging.up.railway.app"
100.64.0.2 - - [23/May/2025:00:02:42 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "https://pacific-nurturing-staging.up.railway.app/"; "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" "45.58.143.214"
2025/05/23 00:02:42 [error] 23#23: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 100.64.0.2, server: app-server, request: "GET /favicon.ico HTTP/1.1", upstream: "http://[fd12:6a89:ec02::66:da68:8a52]:5173/favicon.ico", host: "pacific-nurturing-staging.up.railway.app", referrer: "https://pacific-nurturing-staging.up.railway.app/";
2025/05/23 00:02:45 [error] 23#23: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 100.64.0.2, server: app-server, request: "GET / HTTP/1.1", upstream: "http://[fd12:6a89:ec02::66:da68:8a52]:5173/", host: "pacific-nurturing-staging.up.railway.app"
100.64.0.2 - - [23/May/2025:00:02:45 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" "45.58.143.214"
100.64.0.2 - - [23/May/2025:00:02:46 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "https://pacific-nurturing-staging.up.railway.app/"; "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" "45.58.143.214"
2025/05/23 00:02:46 [error] 23#23: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 100.64.0.2, server: app-server, request: "GET /favicon.ico HTTP/1.1", upstream: "http://[fd12:6a89:ec02::66:da68:8a52]:5173/favicon.ico", host: "pacific-nurturing-staging.up.railway.app", referrer: "https://pacific-nurturing-staging.up.railway.app/";
My proxy conf is: (app-v2 is another container)
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name app-server;
location / {
proxy_pass http://app-v2.railway.internal:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_next_upstream_timeout 5s;
client_max_body_size 50M;
}
brotli on;
brotli_comp_level 4;
brotli_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
}
4 Replies
2 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 2 months ago
2 months ago
Are you able to access the server bypassing Nginx? As in connecting directly to it?
Status changed to Solved pixelpioneer80 • 2 months ago
2 months ago
Solved using caddy
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
Just as reference... if you want to use nginx, you have to specify a dns resolver in your config:
https://station.railway.com/questions/nginx-with-private-networking-upstream-8d7ce3c3
Status changed to Open chandrika • 2 months ago
Status changed to Solved brody • 2 months ago