3 months ago
Hello Railway Support,
I'm experiencing a critical production issue that is blocking my n8n deployment.
Setup:
- n8n in queue mode (primary + worker services)
- Domain: r.wun8.com
- PostgreSQL + Redis on Railway
Problem:
Persistent `ERR_ERL_UNEXPECTED_X_FORWARDED_FOR` errors despite correct configuration.
What I've done:
1. Added `N8N_TRUST_PROXY=1` to BOTH primary and worker services
2. Full redeploy (not restart) of both services
3. Verified /healthz returns OK
Result: Errors persist. The environment variable appears to have NO EFFECT.
Error from logs (after redeploy):**ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR'
Impact:
- Webhooks not registering properly
- New workflows failing to execute
- Production system degraded
**Questions:**
1. Is Railway's proxy stripping or overriding trust proxy settings?
2. Are environment variables actually being injected? How can I verify?
3. Is there a Railway-specific configuration required for Express apps behind your proxy?
This configuration worked previously. Something changed on Railway's side or with how env vars are being passed to containers.
I need urgent assistance as this is affecting production workloads.3 Replies
3 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
3 months ago
This is not helpful. The bot suggestions don't address my issue.
I've tried:
- N8N_TRUST_PROXY=1
- N8N_TRUST_PROXY=true
- Full redeploy of both services
The error persists. I need a human to investigate why Railway's proxy is not respecting the trust proxy configuration in my Express-based n8n application.
Please escalate.
usabdnik
This is not helpful. The bot suggestions don't address my issue.I've tried:- N8N_TRUST_PROXY=1- N8N_TRUST_PROXY=true- Full redeploy of both servicesThe error persists. I need a human to investigate why Railway's proxy is not respecting the trust proxy configuration in my Express-based n8n application.Please escalate.
3 months ago
Hey there, I was able to add the N8N_TRUST_PROXY=true variable to the Primary service and it looks like its working fine right now. If you've gotten any errors after deploying that change to that service, may it happen to be a health check running before the trust-proxy=false at runtime, since I can't seem to re-produce it afterwards.
Status changed to Awaiting User Response Railway • 3 months ago
2 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 2 months ago