Streaming live at 10am (PST)

Partial site hosting with reverse proxy


#1

I am trying to host a component of my site (/en/privacy-policy) on webflow by using an nginx reverse proxy, but am getting the following fastly error.

I’ve added the custom domain to my site, however, I wouldn’t expect it to be ‘Connected’ because that domain name is pointed towards my nginx server, not to webflow’s proxy server.

This is what my nginx server configuration looks like:

server {
    listen 80;
    server_name www.dev.canimmunize.ca;

    location /en/privacy-policy {
      proxy_pass http://cameronbell-990c7f3cf051df1661923782768.webflow.io$request_uri;
    }
}

Thanks!


#2

Hey @cameronbell

With the nginx config you posted, nginx will proxy the request to our server without changing the hostname of the request. Since we do dynamic routing based on hostnames, the hostname included in the request must actually match the site you are trying to proxy to.

I think the additional line in the location block of your config you need is this:

proxy_set_header Host cameronbell-990c7f3cf051df1661923782768.webflow.io

#3

Thanks!

In the end, I ended up setting up the webflow site on a different subdomain (wf.canimmunize.ca), which allowed the domain to be properly connected to that subdomain. And then I proxied my desired domain to that subdomain like so:

location /en/privacy-policy {
    proxy_ssl_server_name on;
    proxy_redirect https://wf.canimmunize.ca https://www.dev.canimmunize.ca;
    proxy_redirect http://wf.canimmunize.ca https://www.dev.canimmunize.ca;
    proxy_pass https://wf.canimmunize.ca$request_uri;
}