# Reverse proxy ghost in next.js app deployed on Vercel

**URL:** <https://forum.ghost.org/t/reverse-proxy-ghost-in-next-js-app-deployed-on-vercel/41336>\
**Category:** Installation\
**Created:** [September 19, 2023, 5:45pm UTC](https://forum.ghost.org/t/reverse-proxy-ghost-in-next-js-app-deployed-on-vercel/41336 "2023-09-19T17:45:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Allen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/barry_allen/32/26431_2.png) [@Barry\_Allen](https://forum.ghost.org/u/Barry_Allen)\
**Post date:** [September 19, 2023, 5:45pm UTC](https://forum.ghost.org/t/reverse-proxy-ghost-in-next-js-app-deployed-on-vercel/41336/1 "2023-09-19T17:45:02Z")

</div>

I want to reverse proxy my ghost blogs into a next app hosted on vercel,

I tried adding this in next.config.js but it redirects me to `https://error.ghost.org/`

```auto
/** @type {import('next').NextConfig} */
const nextConfig = {
  trailingSlash: true,
  async rewrites() {
    return [     
      {
        source: "/blog/:path*/",
        destination: "https://<subdomain>.ghost.io/blog/:path*/",
      },
      {
        source: "/blog/:path*",
        destination: "https://<subdomain>.ghost.io/blog/:path*",
      }    
    ];
  },
  async headers() {
    return [
      {
        source: "/blog/:path*",
        headers: [{ key: "x-forwarded-host", value: "your-custom-domain.com" }],
      }
    ];
  }
}

module.exports = nextConfig

```

can someone help me to create reverse proxy for this in detail?

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [September 21, 2023, 9:10am UTC](https://forum.ghost.org/t/reverse-proxy-ghost-in-next-js-app-deployed-on-vercel/41336/2 "2023-09-21T09:10:29Z")

</div>

For questions about detailed Next.js syntax, I recommend trying the Next.js discussion forum:

> **[vercel/next.js · Discussions](https://github.com/vercel/next.js/discussions)**
>
> Explore the GitHub Discussions forum for vercel next.js. Discuss code, ask questions & collaborate with the developer community.
