Help with reverse proxy

I have a blog project created at https://barkibu-content.webflow.io/, however, I want to be able to display it under my own domain, which would be barkibu.com, so that when browsing to barkibu.com/blog it loads the information hosted at https://barkibu-content.webflow.io/.

To do this I have made a local reverse proxy in Ruby on Rails using the rack-reverse-proxy gem, as shown in this application.rb code:

config.middleware.insert(0, Rack::ReverseProxy) do
      reverse_proxy_options preserve_host: true
     
      # Add a reverse proxy rule for the /blog route
      reverse_proxy /^\/blog(\/.*)$/, 'https://barkibu-content.webflow.io/$1'
end

The problem I am facing is that when navigating to the following URLs I am encountering the following behaviors:

  • localhost:3000/blog → It loads the content of https://barkibu-content.webflow.io/ and keeps the original host (localhost:3000)
  • localhost:3000/blog/post/cupon-de-descuento-de-barkibu → loads the content of Cupón de descuento Barkibu de 25€, however, it no longer maintains the original host and when I navigate to this URL both from an internal link or by typing it directly into the browser, a 301 redirection occurs from localhost:3000/blog/post/cupon-de-descuento-de-barkibu to https ://barkibu-content.webflow.io/post/cupon-de-descuento-de-barkibu.

This happens in all the pages and subdirectories of my Webflow project, except in the root directory, which does keep the host, when I want it to keep the host in all the pages. Is this happening due to some kind of Webflow limitation or do you see something misconfigured in my code?


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

I think you won’t be able to do reverse proxy from standard webflow domain but would rather need a subdomain connected to the WEbflow project. I’ve done reverse proxy a few times but it was always via cloudflare so I’m not sure how relevant it is to your situation but that’s how we’ve managed to do it.

Guide: How to Reverse Proxy a Webflow project with Cloudflare Workers · Guide: How to Reverse Proxy with Cloudflare Workers You have some more guidance here so if it works for your use case feel free to check it out

In the end I have created a subdomain “webflowblog.barkibu.com” pointing to “barkibu-content.webflow.io”, and I have made the reverse proxy to webflowblog.barkibu.com, but still I find the same problem, when I navigate to the home through these links the following happens:

https://bkb-insurance-br-feature-webfl.herokuapp.com/blogtest-> Correctly loads the home of the webflow project and maintains the host

Por qué el momento ideal para contratar un seguro para tu mascota es ahora - > The page loads correctly but it does a 301 to the webflowblog.barkibu.com subdomain, which does not preserve the host for me.