← Back to methods

METHOD 3: REVERSE PROXY & CNAME

Reverse Proxy & Custom Subdomain Rewrites

Serve fully server-rendered (SSR), SEO-optimised blog pages directly from your primary domain at `/blog` or a custom subdomain like `blog.yourdomain.com`.

Why use a Reverse Proxy?

When using the JavaScript widget, search engines see an empty mount point container until JavaScript executes. By configuring a **Reverse Proxy**, your web server fetches pre-rendered HTML from EmbedCMS on the server side. Google crawls the page instantly, ranking it under your own domain.

Canonical URL Setting

To ensure search engines attribute SEO value to your domain (and not our proxy server), input your **Public Blog URL** (e.g. `https://yourdomain.com/blog`) in the Site Settings. EmbedCMS will automatically inject a self-referencing canonical tag onto all server-rendered pages.

Vercel Rewrites Setup (`vercel.json`)

vercel.json
{
  "rewrites": [
    { "source": "/blog", "destination": "https://embedcms.com/sites/YOUR_KEY/blog" },
    { "source": "/blog/:path*", "destination": "https://embedcms.com/sites/YOUR_KEY/blog/:path*" }
  ]
}

Nginx Proxy Configuration

nginx.conf
location /blog/ {
  proxy_pass https://embedcms.com/sites/YOUR_KEY/blog/;
  proxy_set_header Host embedcms.com;
}

Live SSR Mock Viewer

Below is a browser frame displaying the raw server-rendered SSR blog output for this project.

https://yourdomain.com/blog