OK, so, I’m stumped - I spent most of yesterday trying to figure this one out:
I have a rails app, which runs as it should if accessed as http://MYDOMAIN:8001/
After speaking to a DH support person, I set up proxying so that that unsightly port is not visible in the url. Now the rails app is visible at http://MYDOMAIN/books
However, two issues:
- The rails app continues to, understandably, route links to /[rails app name]/[:id], which means the browser goes looking for http://MYDOMAIN/[rails app name]/[:id] (or in the case of the “about” page, http://MYDOMAIN/about) and predictably does not find what should be there. The content shows up if I manually input http://MYDOMAIN/books/[rails app name]/[:id] (or http://MYDOMAIN/books/about).
This is fine! I just want to know how to get Rails (or Apache???) to understand that if I’m going through the proxy, it should link to /books/[whatever] instead of /[whatever].
I am reluctant to change the routes within the app, since I would prefer it still work as normal if accessed explicitly through http://MYDOMAIN:8001/
- Assets! Hoo boy. There are approximately eight trillion different search results for people having trouble routing assets, nearly every one of which insists that the solution is precompiling them.
Buddy, let me tell you: it is not.
As mentioned before http://MYDOMAIN/books shows the appropriate content from my rails app, but with no styling. No matter what I do, I make sure the precompiled .js and .css are in the [app root]/public/assets/ folder, and chowned and chmodded appropriately, but they 404 every time.
So I’ve gone through every suggestion I could find. If you’re thinking “maybe I’ll just google this guy’s problem and post a link to literally the first result”, probably don’t do that, because I promise you I have seen that DH forum thread or that stackoverflow discussion or that blog post, and they either were of no help to me or were too different from my setup to be applicable. So if you have any suggestions that aren’t covered already, I’m listening.
(Also, if this is in the wrong forum, feel free to yell at me)
ETA: Rails is v.4.2.4, server is DH VPS running Apache