Proxying to Hubspot web pages, landing pages, etc


G’day Hubspot developers forum.

We were looking into wrapping our own application around our Hubspot landing pages and site pages using a proxy from our end that fetches a Hubspot page, strips out any headers and footers and then injects it into our own page to present to the user. This allows us to have a consistent user experience by keeping all of our JavaScript and CSS in our application, have our headers and footers be consistent, etc. while still allowing our content managers to quickly create content within the Hubspot environment as they are normally used to.

Our application is being written in Rails and we’re very much in start-up mode, and we’d like to leverage Hubspot’s CMS while keeping JavaScript and CSS in one place and consistent and to reduce duplication.

The basic process is:

  • fetch a Hubspot page from our server-side app
  • parse the result via an HTML parser and pull out the tags and CSS links as necessary
  • inject your into our page as well as any tags and CSS we found above, along with our own application-specific JavaScript and CSS
  • inject your analytics snippet into the page
  • to reduce network use and improve UX, we cache the results of each fetch for an hour

Does this actually sound sane or is this a terrible idea? It is working at the moment, for some definition of “working”. Is there anything more we should be doing? For instance, we don’t pass IP address or cookies to Hubspot when we do our server-side fetch, but we could do that if it would improve the process. I’m hoping that using the Hubspot analytics snippet will provide that capability so that we don’t have to. We also pass along the path and query parameters of the request from our end untouched to Hubspot, so if someone accesses http://our-app/some/path?foo=bar, we connect to http://our-hubspot-cms/some/path?foo=bar accordingly.

Does any of this sound sane or is this a bad idea? I’d be appreciative of any help or advice you can provide.


Proxy forwarding sub-domain to sub-directory

Hi @jaysecuricy

Using a proxy for HubSpot hosted pages isn’t something we support or recommend. Our platform sits behind a CDN/Firewall system, and if we detect a large number of requests from a single source (in this case, your server), we may automatically start blocking requests from that source. You may not have an issue with this right away, but as your traffic grows you’re more likely to run into those automatic blocks.


G’day dadams.

Any chance your CDN/firewall detects for things like the X-Forwarded-For HTTP header or something similar? We can set the value for that header to whatever the incoming user IP, similar to how any other proxy system works. Presumably your CDN/firewall would already be detecting for something similar, otherwise you’d be blocking out proxy or caching servers as it is, so I’m just assuming you’ve already accounted for that issue somewhere in your infrastructure.



i’m curious if there are any updates on this thread? i’m not doing something as elaborate as @jaysecuricy, but i do want to pull in blog content from hubspot into my site via a server-side call. does that mean my web server could also get blocked? is there some sort of caching that hubspot recommends so that i don’t hit the hubspot api too frequently?


We have published Hubspot landing pages. Since we are using these pages in our website, we don't require Hubspot specific words in URL.

We need the URL to look like[landing-page].
We were doing it by adding a proxy in our server and it was working till last month. But now CSS resources are not loading for the landing page for the proxy URL.

Need a solution to fix the problem. Thanks in advance.


We're running into this issue too. We'd like to whitelist our proxy's IP.


Hey, all.

Apologies that this topic hasn't gotten attention in quite a while.

To set the record straight, the security team has confirmed that we do not support or plan to support using proxy servers to access HubSpot CDN-hosted content.

This includes using X-Forwarded-For headers. Additionally, we will not be whitelisting proxy server IPs. As David states above, your users may not experience issues with this immediately, but we cannot guarantee reliability under any circumstances.