This is a simple repo.
It's purpose it to create a proxy to a site you own.
- You have a domain point to Vercel
- Vecel has a "redirect/rewrite" rule that doesn't redirect instead proxies
- That's it
- A github account.
- Access to your DNS for the domain to create appropriate records.
- A Vercel account.
- A Git repository pointing to the proper domain like this one.
You can read the repo's readme, or follow along here. Also there are at least two other ways to do this. One is using ServiceNow's custom URL feature. The other is some magic on Cloudflare.
- Login with GitHub, trust me.
- Enter a project name, I called mine
pdi-redirect
. - Pick GitHub.
- Create the repositry private or public, your choice.
- Leave the Import Project settings, they were auto-detected by Vercel, and "Deploy".
- Now it's building, it'll take about 20 seconds to build.
- You should get a ๐ CONGRATULATIONS ๐ message. It should work now.
Well, it's redirecting to my site. Let's fix that.
- Goto your git source where that button created the repo.
- Update the
./_includes/layout/redirect.njk
file to the site you want. - Vercel should trigger a build and update index.html and 404.html to redirect to your site.
- Now you need to set up the domain. To do that goto "Domains",
- It'll ask what project you want to use, pick the one you made from #1.
- It will show you, that your DNS is wrong. Go forth and set the dns as depicted.
- Comeback to Vercel's domain page and "Refresh" your domain entry. You may need to wait for your DNS to propegate.
- That's it.