{"Status":true,"Message":"","Response":{"post":{"postuid":"3aaaa21c-8cce-40cb-adad-8655d2493aae","tenantuid":"d8b744fc-2e70-4089-bb80-dd1d08f6c7b2","projectuid":"fc6490ac-7527-4f49-b06e-46f701280e85","title":"Setup Reverse Proxy","slug":"article/setup-reverse-proxy","html":"\u003Cp\u003EHelpGuides support configuration of reverse proxy for advanced scenarios.\u003C/p\u003E\u003Ch2 id=\u0022what_is_reverse_proxy\u0022\u003EWhat is Reverse Proxy?\u003C/h2\u003E\u003Cp\u003EFor the sake of example, let\u0027s say you own a domain \u003Ccode class=\u0022inline-code\u0022\u003Eexample.com\u003C/code\u003E. You have an existing website using that domain running WordPress where you host a blog: \u003Ccode class=\u0022inline-code\u0022\u003Eexample.com/blog/example-name\u003C/code\u003E.\u003C/p\u003E\u003Cp\u003EYou then created a project on HelpGuides \u003Ccode class=\u0022inline-code\u0022\u003Emyproject.helpguides.io\u003C/code\u003E. And, you want to move your blog content from WordPress to HelpGuides while still using WordPress for your main website. This setup is known as a reverse proxy.\u003C/p\u003E\u003Ch3 id=\u0022how_it_works\u0022\u003EHow it works\u003C/h3\u003E\u003Cp\u003ERequests sent to \u003Ccode class=\u0022inline-code\u0022\u003Eexample.com/blog/example-name\u003C/code\u003E are proxied to \u003Ccode class=\u0022inline-code\u0022\u003Emyproject.helpguides.io/example-name\u003C/code\u003E. The blog content is hosted at \u003Ccode class=\u0022inline-code\u0022\u003Emyproject.helpguides.io\u003C/code\u003E, but the browser URL and canonical URL remains \u003Ccode class=\u0022inline-code\u0022\u003Eexample.com/blog/example-name\u003C/code\u003E.\u003C/p\u003E\u003Ch3 id=\u0022why_use_a_reverse_proxy\u0022\u003EWhy use a reverse proxy?\u003C/h3\u003E\u003Cp\u003EThe use case for a reverse proxy is:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003EMigrate content to a more robust platform, e.g. HelpGuides (search, APIs, AI tools, etc.)\u003C/li\u003E\u003Cli\u003EDo not break existing, published URLs\u003C/li\u003E\u003Cli\u003EEnsure that content remains associated with the root domain vs. a subdomain - good for SEO.\u003C/li\u003E\u003C/ul\u003E\u003Ch2 id=\u0022setting_up_a_reverse_proxy\u0022\u003ESetting up a Reverse Proxy\u003C/h2\u003E\u003Cp\u003ESetting up a Reverse Proxy is a complex topic. But platforms such as Cloudflare make these types of advanced configurations relatively simple.\u003C/p\u003E\u003Ccite class=\u0022recommended\u0022\u003E\u003Cspan class=\u0022title\u0022\u003ERecommended\u003C/span\u003E\u003Cp\u003EIf you want to support a reverse proxy for your HelpGuides content, please contact support. Reverse proxy configuration is only available in our enterprise plans.\u003C/p\u003E\u003C/cite\u003E\u003Ch3 id=\u0022reverse_proxy_with_cloudflare\u0022\u003EReverse Proxy with Cloudflare\u003C/h3\u003E\u003Ccite class=\u0022important\u0022\u003E\u003Cspan class=\u0022title\u0022\u003EImportant\u003C/span\u003E\u003Cp\u003ESetting up a reverse proxy with Cloudflare requires mapping your DNS record to Cloudflare. If you cannot do this, you cannot use Cloudflare for reverse DNS.\u003C/p\u003E\u003C/cite\u003E\u003Ch4 id=\u0022step_1__get_your_application_domain\u0022\u003EStep 1 - Get your application domain\u003C/h4\u003E\u003Cp\u003EYou Application Domain is found in your HelpGuides project settings:\u003C/p\u003E\u003Cimg class=\u0022lazy-load\u0022 data-width=\u0022870\u0022 data-height=\u0022480\u0022 data-src=\u0022https://graffiti-auf7e6dwhxhcbwek.z03.azurefd.net/d8b744fc-2e70-4089-bb80-dd1d08f6c7b2/fc6490ac-7527-4f49-b06e-46f701280e85/f2a558c7-713a-4aea-9738-109f4039dbdc.png?v=690928257\u0022 style=\u0022\u0022 alt=\u0022\u0022/\u003E\u003Cp\u003EWhen no reverse proxy is used, this is the path used for your documentation hosted on HelpGuides. Note, HelpGuides does support custom subdomains too.\u003C/p\u003E\u003Ch4 id=\u0022step_2__get_your_canonical_path\u0022\u003EStep 2 - Get your canonical path\u003C/h4\u003E\u003Cp\u003EYour canonical path is configured by the HelpGuides team. Once configured you can find it on the Advanced Tab in settings:\u003C/p\u003E\u003Cimg class=\u0022lazy-load\u0022 data-width=\u00221163\u0022 data-height=\u0022463\u0022 data-src=\u0022https://graffiti-auf7e6dwhxhcbwek.z03.azurefd.net/d8b744fc-2e70-4089-bb80-dd1d08f6c7b2/fc6490ac-7527-4f49-b06e-46f701280e85/71372a38-d720-445f-8867-66ed15db84a4.png?v=2082973682\u0022 style=\u0022\u0022 alt=\u0022\u0022/\u003E\u003Cp\u003EIn the above example, we\u0027re showing how we map requests to httsp://helpguides.io/blog to our main domain https://vszh13.helpguides.io. This could just as easily be https://yourdomain.com/blog mapping to https://[your subdomain].helpguides.io.\u003C/p\u003E\u003Ch4 id=\u0022step_3__create_a_cloudflare_worker\u0022\u003EStep 3 - Create a Cloudflare worker\u003C/h4\u003E\u003Cp\u003ECreate a Cloudflare worker to manage reverse proxy requests from your domain into your helpguides.io project. You will need your Application Domain. The script below is used to rewrite requests that have a /blog/.\u003C/p\u003E\u003Cp\u003EFor example, a request to:\u003C/p\u003E\u003Cp\u003Ehttps://helpguides.io/blog/helpguidesio-now-supports-model-context-protocol-mcp\u003C/p\u003E\u003Cp\u003Eis reverse proxied to:\u003C/p\u003E\u003Cp\u003Ehttps://vszh13.helpguides.io/helpguidesio-now-supports-model-context-protocol-mcp\u003C/p\u003E\u003Cp\u003EIf you are going to use different paths, your configuration may be different.\u003C/p\u003E\u003Cdiv class=\u0022code_wrapper\u0022\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022javascript\u0022\u003Eexport default {\r\n    const app_domain \u0026quot;https://vszh13.helpguides.io/\u0026quot;;\r\n\r\n  async fetch(request, env, ctx) {\r\n    const incomingUrl = new URL(request.url);\r\n\r\n    // Check if path starts with /blog or is exactly /blog\r\n    if (incomingUrl.pathname === \u0026quot;/blog\u0026quot; || incomingUrl.pathname === \u0026quot;/blog/\u0026quot;) {\r\n      // Handle root blog page\r\n      return fetchAndProcess(app_domain, request, incomingUrl);\r\n    }\r\n\r\n    // Handle all other blog paths like /blog/hello-world, /blog/site.json\r\n    if (incomingUrl.pathname.startsWith(\u0026quot;/blog/\u0026quot;)) {\r\n      const targetPath = incomingUrl.pathname.replace(\u0026quot;/blog\u0026quot;, \u0026quot;\u0026quot;);\r\n      const targetUrl = \u0060${app_domain}${targetPath}${incomingUrl.search}\u0060;\r\n      return fetchAndProcess(targetUrl, request, incomingUrl);\r\n    }\r\n\r\n    return new Response(\u0026quot;Not Found\u0026quot;, { status: 404 });\r\n  }\r\n}\r\n\r\n// Extracted handler function for reuse\r\nasync function fetchAndProcess(targetUrl, originalRequest, incomingUrl) {\r\n  const proxyRequest = new Request(targetUrl, {\r\n      method: originalRequest.method,\r\n      headers: new Headers({\r\n          ...Object.fromEntries(originalRequest.headers),\r\n          \u0026#39;X-Forwarded-Host\u0026#39;: incomingUrl.hostname,  // passes \u0026quot;root domain\u0026quot;\r\n      }),\r\n      body: originalRequest.body,\r\n      redirect: \u0026quot;manual\u0026quot;\r\n  });\r\n\r\n  const originResponse = await fetch(proxyRequest);\r\n  const contentType = originResponse.headers.get(\u0026quot;Content-Type\u0026quot;) || \u0026quot;\u0026quot;;\r\n\r\n  // HTML: rewrite relative paths\r\n  if (contentType.includes(\u0026quot;text/html\u0026quot;)) {\r\n    let html = await originResponse.text();\r\n\r\n    html = html.replace(/(href|src)=[\u0026quot;\u0026#39;]\\/(?!\\/)/g, \u0060$1=\u0026quot;${app_domain}\u0060);\r\n\r\n    return new Response(html, {\r\n      status: originResponse.status,\r\n      headers: {\r\n        \u0026quot;Content-Type\u0026quot;: \u0026quot;text/html\u0026quot;,\r\n        \u0026quot;Cache-Control\u0026quot;: \u0026quot;public, max-age=60\u0026quot;\r\n      }\r\n    });\r\n  }\r\n\r\n  // Other file types (CSS, JSON, etc.)\r\n  return new Response(originResponse.body, {\r\n    status: originResponse.status,\r\n    headers: originResponse.headers\r\n  });\r\n}\u003C/div\u003E\u003C/div\u003E","publish_status":0,"post_type":"Article","authoruid":"3dde8c16-763a-4a2b-ae0b-1d8c50c62e3d","author":{"authoruid":"3dde8c16-763a-4a2b-ae0b-1d8c50c62e3d"},"featured_image_updating":false,"meta_description":"Learn what a reverse proxy is and how to use it to migrate blog content to HelpGuides while maintaining your site\u0027s URLs and improving SEO.","display_toc":false,"has_workingcopy":false,"allow_indexing":true,"total_views":260,"date_published":"2025-06-16T18:34:00","date_updated":"2026-03-23T16:48:05.967","date_created":"2025-06-04T20:32:35.013"}}}