CMS Development

DenisG
メンバー

Reverse proxy on IIS server

Hi,

I'm trying to set up a reverse proxy for the blog by following this tutorial : https://developers.hubspot.com/docs/cms/developer-reference/reverse-proxy-support

The domain is configured on Hubspot and "Ready for publishing".

 

The IIS server is configured to enable proxy. I have defined rewrite rules for www.mydomain.com/en/blog to https://HubID.suffix/en/blog

(and also for /_hcms/*, /hs/*/hubfs/*/hs-fs/*, and /cs/c/* )

 

The proxy seems to be correct, as it works if I change the rewrite rule to www.google.com for example)

 

But with the Hubspot URL, this is the page displayed.

DenisG_0-1669914698931.png

The diagnostic page doesn't work too.

 

I can see the HTTP headers x-hubspot-trust-forwarded-for and x-hs-public-host, but there is also the following ones :

x-hubspot-notfound: true

x-hs-reason: domain XXXXX.sites-proxy.hscoscdn10.net does not exist

 

I don't know what I'm missing. Any help would be greatly appreciated 🙂 

3件の返信
DenisG
メンバー

Reverse proxy on IIS server

Hi @Jaycee_Lewis,

Thanks for the link but it didn't help.

I realised that I was not sending correctly the HTTP headers, now it's ok, but still not working.

 

I'm seeing a 404 when going to the diagnostics URL https://[myDomain]/_hcms/diagnostics.

 

Here are the headers from the https://[myDomain]/_hcms/_worker/headers

 

accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
accept-encoding: "gzip"
accept-language: "en-US,en;q=0.9,fr;q=0.8,pt;q=0.7,es;q=0.6,fr-FR;q=0.5,pt-PT;q=0.4"
cache-control: "no-cache"
cf-connecting-ip: "[serverIp]"
cf-ipcountry: "NL"
cf-ray: "7753bf3d4cb2b902"
cf-visitor: "{"scheme":"https"}"
connection: "Keep-Alive"
cookie: "[removed]"
host: "[myHubId].sites-proxy.hscoscdn10.net"
max-forwards: "10"
pragma: "no-cache"
sec-ch-ua: ""Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108""
sec-ch-ua-mobile: "?0"
sec-ch-ua-platform: ""Windows""
sec-fetch-dest: "document"
sec-fetch-mode: "navigate"
sec-fetch-site: "none"
sec-fetch-user: "?1"
true-client-ip: "[serverIp]"
upgrade-insecure-requests: "1"
user-agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
x-arr-log-id: "148e19d4-faa1-4854-accd-68950963dac3"
x-arr-ssl: "2048|256|C=GB, S=Greater Manchester, L=Salford, O=Sectigo Limited, CN=Sectigo RSA Domain Validation Secure Server CA|CN=isdecisions.com"
x-forwarded-for: "185.182.168.24:57334"
x-forwarded-proto: "https"
x-hs-cfworker-source: "hs-cos-cdn-worker"
x-hs-public-host: "[www.myDomain.com]"
x-hs-zone-name: "hscoscdn10.net"
x-hubspot-trust-forwarded-for: "true"
x-original-url: "/_hcms/_worker/headers"
x-real-ip: "[serverIp]"

 

 

When visiting https://www.mydomain.com/en/blog I can see the following Request Headers :

 

x-hs-reason: domain [www.mydomain.com] does not exist

x-hubspot-correlation-id: 479250b3-8597-49f3-a49a-50bdb42de334

x-hubspot-notfound: true
 
which means that the x-hs-public-host header is correctly configured right ?
 
So I don't know what's missing here.
0 いいね!
DenisG
メンバー

Reverse proxy on IIS server

The domain status is now "Connected to reverse proxy", so configuration looks ok, but pages are still "not available".

DenisG_0-1670336008508.png

 

0 いいね!
Jaycee_Lewis
コミュニティーマネージャー
コミュニティーマネージャー

Reverse proxy on IIS server

Hey, @DenisG 👋 Thanks for reaching out. I'll tag in @coldrickjack @LeeBartelme  @Mike_Eastwood and add this post for reference — Lessons Learned from Setting up a Reverse Proxy With HubSpot CMS (includes sample nginx config!)

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 いいね!