Back to blog

Railway prerendering: generated domains, middleware, and custom-domain routing

A Prerender Buddy setup decision guide for Railway public domains, custom domains, middleware, environment variables, and crawler routing.

Platforms
Jun 29, 2026
4 min read

Railway can run a full web service, so it offers more integration control than static-only hosting.

Quick answer

If the server already sends complete HTML, you probably do not need Prerender Buddy. If visitors see a complete JavaScript page but bots receive thin HTML or an empty app shell, Prerender Buddy can help by serving rendered HTML to search engines and AI crawlers.

Two practical paths

Use server-side middleware

Choose this when your Express, Next.js, or other server already receives public requests. Add crawler detection before the app shell response, keep the Prerender Buddy key in Railway variables, and skip APIs, assets, authentication, checkout, and private routes.

Use a Railway public domain as origin

Railway can generate a public *.up.railway.app domain. If it remains enabled and independently serves the same visitor application, it can be a managed DNS origin while the public custom hostname points through Prerender Buddy.

Do not use the private railway.internal hostname as a public origin. It is only for communication inside Railway's private network.

Custom-domain caution

Railway's own custom-domain setup requires both the CNAME and TXT records it provides. If Prerender Buddy becomes the public DNS path, keep a separate Railway domain enabled and verify that auth callbacks, absolute URLs, and host-based application logic still use the intended public domain.

Verification

Test normal and crawler requests for the exact hostname. Check Railway deploy logs, Prerender Buddy render logs, status codes, cache headers, and representative public routes.

See Railway public networking, API key safety, and Self-hosted setup.

Who this is for

  • SaaS founders with already-shipped JavaScript websites
  • React, Vite, Vue, Lovable, Bolt, or Base44 users
  • SEO freelancers checking crawler-readable HTML
  • Agencies maintaining client sites without rebuilding them

You may not need Prerender Buddy if

  • Server HTML is already complete.
  • Static pages crawl correctly.
  • You are already rebuilding with SSR or static generation.
  • You only need an audit, not a rendering fix.

Check the site before changing the stack

Final recap

Railway prerendering comes down to what search engines and AI crawlers actually receive from your site.

Prerender Buddy does not guarantee rankings or AI citations. It helps with one specific technical problem: making sure crawlers receive readable rendered HTML instead of a thin JavaScript shell.

The first step is to check what bots see.

Check your website

Scan important pages from this site to test whether the site sends readable HTML to search engines and AI crawlers.