Ghost at /blog, not on a subdomain.
Ghost can serve a publication at yourdomain.com/blog behind a reverse proxy. Self-hosted, it is one config value. On Ghost(Pro) it is a $50/month add-on to the Business plan, and the proxy is still yours to run. This guide follows Ghost's own rules and validation request, then covers the robots.txt file that stops working once Ghost moves under a path.
Published October 9, 2026. Ghost documentation, pricing, and source checked the same day.
Which Ghost setup are you on?
Both paths end with a reverse proxy you operate. What differs is who hosts Ghost and what it costs to be allowed a path. Ghost(Pro) figures are from Ghost's pricing page, which calls the setup non-trivial and recommends it only for teams willing to maintain the infrastructure.
Ghost(Pro)
- Plan
- Business, $199/mo billed yearly
- Subdirectory
- +$50/mo add-on
- Proxy
- Yours to run and maintain
- Also needed
- Ask Ghost to set the path
Self-hosted Ghost
- Plan
- None, open source
- Subdirectory
- Set in the url config
- Proxy
- Yours to run and maintain
- Also needed
- The server, updates, backups
What does Ghost(Pro) require from the proxy?
Eight rules, all from Ghost's subdirectory help article. Two of them end in redirect loops when missed, which makes them the easiest to spot. The X-Forwarded-For and DNS rules fail quietly: Ghost warns of rate limiting for the first and an outage without warning for the second.
HTTPS with a valid certificate
https only
Ghost(Pro) only supports HTTPS traffic.
Redirect HTTP to HTTPS
At the proxy
Ghost says it is more performant to do this at the proxy level.
Host header
yoursite.ghost.io
Required to get through Ghost’s security layer.
X-Forwarded-Host
yourdomain.com
Without it the blog redirects to the ghost.io subdomain, causing a loop.
X-Forwarded-Proto
https
Without it the blog redirects to https, causing a loop.
X-Forwarded-For
The visitor’s IP, only
Ghost cannot spot spam patterns and may rate-limit the site. Appending to the header the client sent lets visitors spoof their IP.
Methods and headers
HEAD GET POST PUT DELETE
Forwarded intact, with all standard headers and any x-ghost headers, including Authorization and set-cookie.
DNS resolution
Dynamic
Ghost’s IPs change regularly. A proxy that caches them goes offline without warning.
Can you paste Ghost's example config as is?
Mostly, and Ghost says each one was tested with its exact settings. Read them against the rules first, because the examples and the rules do not line up everywhere.
The nginx example appends to X-Forwarded-For
It uses $proxy_add_x_forwarded_for, which per the nginx docs takes whatever X-Forwarded-For the client sent and appends the real address. Rule 6 asks for the client IP only. If you write your own config, $remote_addr sends just the connecting IP.
Not every example sets every header
The nginx block sets Host, X-Forwarded-Host, and X-Forwarded-For, but no X-Forwarded-Proto line. The Netlify example sets only X-Forwarded-Host, and the Vercel and Next.js examples set no headers at all. Ghost marks several examples as tested with their exact settings, so treat the validation request below as the arbiter rather than counting header lines.
The /blog prefix is never stripped
Every example forwards /blog/... to yoursite.ghost.io/blog/..., path intact. That only works after Ghost has been told the path, which is why contacting Ghost is a required step and not a courtesy.
nginx needs a resolver line
Ghost’s nginx example puts the upstream in a variable with a resolver directive so the IP is looked up again. Ghost warns that nginx without a resolver caches the IP and the site goes offline when Ghost’s infrastructure changes.
Next.js on Vercel redirects trailing slashes
Ghost says to set skipTrailingSlashRedirect to true. If you cannot, it gives a second rewrite set that splits asset paths from page paths, and warns it may need updating later.
X-Forwarded-For behavior from the nginx proxy module docs. Ghost also publishes Apache, CloudFront, and Cloudflare Workers examples, and calls the CloudFront and Workers setups highly advanced.
How do you prove the proxy is right?
Ghost(Pro) answers one test request with a verdict. Send it through your proxy, to your own domain:
curl -IL -H 'x-ghost-proxy:true' https://yourdomain.com/blogLook for an x-ghost-proxy response header set to VALID. On INVALID, Ghost says to check three values first: x-forwarded-host must be your base domain (yourdomain.com, without the path), x-ghost-forwarded-proto must be https, and x-ghost-host must be your ghost.io address. A VALID header covers the headers, not the traffic, so Ghost lists five follow-up checks:
- 1
Log in at /blog/ghost/
Admin works through the proxy, so cookies and Authorization survive.
- 2
Upload an image
POST bodies and large uploads pass. Ghost’s nginx example raises client_max_body_size for this.
- 3
Create and schedule a post
Writes from the editor reach Ghost.
- 4
Delete a post
DELETE requests are forwarded, not dropped.
- 5
Open /blog/sitemap.xml
The changes above show up in the sitemap Ghost generates.
What changes when Ghost is self-hosted?
The path lives in Ghost's own config instead of a support ticket. Ghost's configuration docs say to enter the full path when using a subpath, always with https:
"url": "https://yourdomain.com/blog/"Admin follows the path. The same docs note the admin panel is always served at /ghost/, so it becomes yourdomain.com/blog/ghost/. When Ghost-CLI sets up nginx on the Ghost server, it reads the path from this url and writes a location ^~ /blog/ block rather than one for /.
That block lives on the Ghost server. Whatever answers for yourdomain.com still needs a route that sends /blog/ to it with the prefix intact, the original Host or X-Forwarded-Host, and X-Forwarded-Proto set to https. Ghost's eight Ghost(Pro) rules are written for its hosted platform, but most of them are a sound checklist for this hop too.
Why does Ghost's robots.txt stop counting?
Because it moves to /blog/robots.txt, and crawlers only read one file per host. Ghost mounts its whole app under the configured subdirectory, robots.txt included. Its default robots.txt carries the sitemap line and Disallow rules for paths like /ghost/, /email/, and /r/. Google's robots.txt specification says the file must sit in the top-level directory of a site, so the one that applies is yourdomain.com/robots.txt, served by your main site.
The fix is a few lines in the main site's robots.txt. The sitemap field takes a fully qualified URL, and Google allows as many sitemap lines as you need:
Sitemap: https://yourdomain.com/blog/sitemap.xmlIf you want Ghost's own Disallow rules to apply, copy them across with the /blog prefix added, for example Disallow: /blog/ghost/. The sitemap location itself is fine for a blog: Google's sitemap guidance says a sitemap not submitted in Search Console affects only descendants of its parent directory, and every Ghost URL sits under /blog/.
While you are in view-source, check the canonical on a post. It should name https://yourdomain.com/blog/post-name/. If it names a ghost.io address or the old subdomain, the X-Forwarded-Host or url setting is wrong; our canonical tags guide walks through that failure in detail.
Should you build this yourself?
If your main site already sits behind nginx, Netlify, or Vercel, Ghost's examples get you most of the way. The ongoing part is what Ghost(Pro)'s pricing page warns about: keeping eight rules true as configs change, re-resolving Ghost's IPs, and noticing when a deploy on the main site shadows the /blog route. Ghost itself says its examples are only guaranteed to work in isolation, and that top-level domain config can override the subdirectory.
Whichever route you take, hold the proxy to Ghost's list and run the validation request. That includes a managed service like ours: ask how it sets X-Forwarded-For and whether it resolves upstream DNS dynamically, then check the answer with curl.
Ghost subdirectory FAQs
Can Ghost run on a subdirectory like yourdomain.com/blog?
Yes. Self-hosted Ghost supports it through the url setting, entered with the full path. Ghost(Pro) supports it as a paid add-on on the Business plan, with a reverse proxy you run yourself and a request to Ghost to set the path.
How much does a Ghost(Pro) subdirectory cost?
As of October 9, 2026, Ghost’s pricing page lists the subdirectory setup as a $50/month add-on available only on the Business plan, which is $199/month billed yearly. That is $249 a month before the cost of the proxy itself.
Does Ghost(Pro) run the proxy for me?
No. Ghost’s pricing page says the setup requires customers to run their own self-hosted reverse proxy with a custom configuration, and recommends it only for teams comfortable maintaining complex infrastructure.
How do I know my Ghost proxy is configured correctly?
Send a request with the x-ghost-proxy: true header to your /blog URL. Ghost answers with an x-ghost-proxy response header set to VALID or INVALID. After VALID, Ghost lists five checks: log in, upload an image, create and schedule a post, delete a post, and confirm the sitemap updates.
Will Ghost’s robots.txt work at /blog/robots.txt?
Crawlers will not read it. Google only reads robots.txt from the top-level directory of a host, so the file that counts is yourdomain.com/robots.txt, which your main site serves. Add a Sitemap line for the Ghost sitemap there.
Is a subdirectory better for SEO than blog.yourdomain.com?
Google’s documentation does not say subdirectories rank better, and a Ghost blog on a subdomain can rank well. The argument for the subfolder is keeping links and brand on one host. Our subdomain vs. subfolder guide covers both sides.