2 months ago
I have www.fractalcycles.com added as a custom domain on my frontend service (Next.js, Dockerfile builder, port 8080). The domain is fully verified (green checkmark), DNS CNAME and TXT records are correct and propagated.
The problem: Railway's edge proxy intercepts requests to www.fractalcycles.com and issues a 301 redirect to https://fractalcycles.com:8080/ instead of routing traffic to the app. The internal container port (8080) leaks into the Location header, making the redirect URL unreachable.
Expected behavior: Traffic to www.fractalcycles.com should be routed to the app (like it is for fractalcycles.com), where my Next.js middleware handles the www-to-apex redirect cleanly on port 443.
Evidence from curl:
- location: https://fractalcycles.com:8080/
- - server: railway-edge
The apex domain (fractalcycles.com) works perfectly. Only the www subdomain has this issue. I deleted and re-added the www domain fresh today, verified DNS propagation via Google DNS (8.8.8.8), and the domain shows green/verified in Railway settings. The issue persists.
This may be related to the current CDN incident (X0Q39H56).
Project: fractal-cycles
Service: frontend
Domain: www.fractalcycles.com
7 Replies
Status changed to Awaiting Railway Response Railway • about 2 months ago
2 months ago
Apologies for this issue. We identified that the www custom domain redirect was affected by our CDN caching incident on 2026-03-30 from 11:00–11:30 UTC. During the incident, the edge proxy was incorrectly leaking internal container ports (8080) into the Location header on redirects.
The incident is now resolved, and the redirect should be working correctly.
Can you confirm that www.fractalcycles.com now redirects properly to the apex domain without the internal port in the URL? If this issue persists, it indicates a separate edge proxy bug we'll need to investigate.
Status changed to Awaiting User Response Railway • about 2 months ago
2 months ago
Hi Angelo, thanks for looking into this. Unfortunately the issue is not resolved. As of just now (April 1, 16:12 UTC), the internal port is still leaking into the Location header:
curl -sI "https://www.fractalcycles.com"
HTTP/1.1 301
location: https://fractalcycles.com:8080/
server: railway-edge
The apex domain (fractalcycles.com) continues to work perfectly. Only the www subdomain redirect is affected. Could you please take another look? Thanks.
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Open Railway • about 2 months ago
a month ago
Update (Apr 7, 2026) - Full redirect chain trace:
The bug is specifically in step 2 of the www redirect chain. Here's what happens when a user types www.fractalcycles.com in their browser:
Step 1: http://www.fractalcycles.com
→ 301 to https://www.fractalcycles.com/ --(correct HTTP→HTTPS upgrade)
Step 2: https://www.fractalcycles.com
→ 301 to https://fractalcycles.com:8080/ --(railway-edge leaks internal port)
Step 3: https://fractalcycles.com:8080
→ Connection timeout / insecure warning -- (port not publicly exposed)
The apex domain works perfectly:
http://fractalcycles.com → 301 to https://fractalcycles.com/
https://fractalcycles.com → 200 OK
The Location header in step 2 comes from server: railway-edge (not our app). Our app never receives the request. The expected behavior is Location: https://fractalcycles.com/ (without :8080).
This has persisted since March 30 and is not related to the CDN caching incident (which was resolved). The www domain is properly configured in Railway with a green checkmark, and DNS (CNAME + TXT verification) is correct.
a month ago
You need to create another "Custom domain" for www subdomain
a month ago
Quick update. Still reproducing as of Apr 15, 2026:
$ curl -sI https://www.fractalcycles.com
HTTP/1.1 301
location: https://fractalcycles.com:8080/
server: railway-edge
This has been open for 2+ weeks since the Mar 30 CDN incident. Everything on our side is verified. Custom domain validated green in the dashboard, CNAME correct, Next.js middleware deployed on master. The :8080 redirect is being issued by railway-edge itself, before our app runs.
Any chance of getting this re-triaged to engineering? It's blocking SEO canonicalization since all www inbound traffic hits a dead port. Happy to provide any diagnostics that would help.
Thanks!
a month ago
I'm sorry, but you are mistaken. The :8080 redirect is not being issued by Railway or the Railway Edge; it is being set by your application.
a month ago
Thanks for sticking with this. Your latest reply was correct, the redirect was coming from our app, not the edge. Root cause on our side: our Next.js middleware called request.nextUrl.clone() to build the www to apex redirect, which carried the container's internal port (8080) into the Location header. Overwriting url.host left url.port intact.
Fix: removed the middleware and moved the redirect into next.config.js using a `has: host` matcher with a literal absolute destination (https://fractalcycles.com/:path\*), so there's no URL cloning and no port to leak.
Verified live:
$ curl -sI https://www.fractalcycles.com
HTTP/1.1 308
location: https://fractalcycles.com/
No more :8080. Paths preserved too. Closing this out. Appreciate the pushback, it sent us to the right place.