By Wilson29thID
I’d like routes like /wiki and /forum to pass traffic through to another website (on another host), so it looks to users like they’re on the same domain. I also have a number of redirects, e.g. /xyz redirects to a separate domain to maintain old links.
I currently implement these all in nginx, and “everything else” is proxied to my rails app.
In the DO app platform world, I assume I should use the rails router for redirects, but what about proxying? Should I use rack proxy or something? Or is there some way to control routing at a higher layer in the app platform (e.g. via some ingress container)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You can control the routes for components within your app on the “Components” tab the “HTTP Routes” section. We don’t currently offer the ability to configure arbitrary redirects, though it is functionality we are considering. You should be able to make these redirects easily within the rails routing layer.
As far as reverse proxying, it’s unlikely we’ll add functionality for proxying outside the App Platform directly. I’m not familiar with the Rack::Proxy, but it looks like it could work. You could also run nginx as a service within your application using a Dockerfile. We have an example nginx Dockerfile and configuration available in our sample repos at https://github.com/digitalocean/sample-nginx. To avoid unnecessary load, I recommend keeping your existing routes for the rails application, and add new routes to nginx just for the parts you want to proxy.
Hello, just thought I’d check in a year or so later to see if there’s been any improvement on this in the App Platform?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.