Skip to content

Commit

Permalink
Made changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Haimantika Mitra authored and Haimantika Mitra committed Feb 27, 2024
1 parent 6c84230 commit 462ea08
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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 @@ -122,17 +124,14 @@ async function proxyBlog(request) {
}
```


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.

If your main domain is hosted elsewhere, you need to involve engineers from your team to create above rewrites.

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.

Note: If you are updating your environment variables in Vercel, make sure to manually redeploy to see the changes.
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.

If your main domain is hosted elsewhere, you need to involve engineers from your team to create above rewrites.

### Step 3

Expand Down

0 comments on commit 462ea08

Please sign in to comment.