All threads / How do I configure Rails to use a Proxy URL
Ask A Question


You’re not receiving notifications from this thread.

How do I configure Rails to use a Proxy URL

Mountaindog asked in Servers

Let's say we have a Rails project operating on the domain The way the organization's infrastructure is set up, gets proxied into a new URL called - . When I start the server with Rails s -e production and navigate my browser to, all the CSS, assets, JS is broken. After some research I changed this config:
config.action_controller.asset_host = '' and the CSS, JS, and assets seem to be working again. Great. One thing that's certainly not right is the links / main navigation (routes). For example, when navigating to any page in the browser, for example,, I get a 404. Seems like there should be a "pass-through" when a request comes in it gets mapped it to Does this make sense? I could use some assistance. What's the best approach here?

My Setup
Rails 6.x.x
Ruby 2.7.x


Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.