I am encountering an issue where I receive a “403 Forbidden” error when trying to access my Cloudflare Pages application through a Fly.io reverse proxy.
The reason I need a proxy is because our main site are hosted on Fly but the Documentation site (Docusaurus) is hosted on Cloudflare Pages and we want to serve the Documentation site under the root domain as https://company.com/docs
The following is the example of the proxy conf
location /docs {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $http_host;
set $backend "https://documentation-demo.pages.dev";
proxy_pass $backend;
proxy_ssl_server_name on;
}
Could anyone advice if there is missing header specifically for Cloudflare Pages hosted site?
Note that I was able to proxy to a Discourse forum with additional 2 headers as following:
# A cdck-trust-proxy header with a specific value must be sent with every request
proxy_set_header cdck-trust-proxy xxxxxx;
# Proxy pass to Discourse upstream server. Use variable for resolver to honor DNS changes for upstream proxies
set $backend "https://xxxx-origin-by-discourse.com";
Thanks in advance,
Angeline