https://github.com/vtex/render-root-path-example
Reference app for root path feature implementation. This shows how a CDN should perform host and path rewriting.
https://github.com/vtex/render-root-path-example
xp-developer
Last synced: about 1 year ago
JSON representation
Reference app for root path feature implementation. This shows how a CDN should perform host and path rewriting.
- Host: GitHub
- URL: https://github.com/vtex/render-root-path-example
- Owner: vtex
- Created: 2019-05-04T19:16:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-02T12:53:15.000Z (over 5 years ago)
- Last Synced: 2025-01-26T10:08:15.368Z (about 1 year ago)
- Topics: xp-developer
- Language: TypeScript
- Size: 27.3 KB
- Stars: 1
- Watchers: 11
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Render Root Path Feature Example
Reference app for root path feature implementation. This shows how a reverse proxy should perform host and path rewriting.
## How root path support works in Render
If your main domain is served by a different platform or system and you want to scope a VTEX IO store in a fixed path prefix, you can use the Root Path feature.
For example, given a domain `mybrand.com`, if you want to serve your store under `mybrand.com/ar`, you must:
1 - Create a public domain for your account and add it to License Manager, e.g. `mybrand.com.ar`.
2 - For all requests to `mybrand.com/ar`, configure your reverse proxy to:
2.1 - Rewrite the `Host` header to `mybrand.com.ar`.
2.2 - Rewrite the request `path` removing the prefix. E.g. `/ar/my-product/p` becomes `/my-product/p`.
2.3 - Add a `x-vtex-root-path` header to the request with the value of the removed prefix, e.g. `/ar`.
This will inform Render that all generated links in this site should be prefixed by the root path, in this case `/ar`.
## Example proxy app
This is an example app that performs the rewrites and adds the header for test purposes.