Skip to content

Commit

Permalink
Merge pull request Hashnode#102 from Haimantika/add-steps
Browse files Browse the repository at this point in the history
Added further steps under Cloudflare
  • Loading branch information
panda-sandeep authored Feb 27, 2024
2 parents efce90b + 462ea08 commit 1c09c83
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ async rewrites() {

Once you deploy your project, the subpath installation should work successfully.

Note: If you are updating your environment variables in Vercel, make sure to manually redeploy to see the changes.

#### Cloudflare

In case you are using Cloudflare in proxy mode (orange cloud on), you can deploy the following worker script and map it to `yourdomain.com/*`:
Expand Down Expand Up @@ -124,6 +126,10 @@ async function proxyBlog(request) {
}
```

After the above step is done, follow these steps to add the worker route:
- Go to `Websites` then click on your website and select `Worker Routes` from the left pane.
- Click on `Add route` and add `https://yourdomain/*` , then select the worker you just added above and click `Save`.
- Go to `https://yourdomain/yoursubpath` and now you should be able to see your blogs.

Be sure to replace the values of `subpath` and `blogBaseUrl` in the above code snippet. This way cloudflare will proxy all the requests starting with `yourdomain.com/blog` to your headless blog, and other requests will hit your origin as usual.

Expand Down

0 comments on commit 1c09c83

Please sign in to comment.