IIS web.config for pre-rendering JavaScript single page apps with Headless-Render-API.com (formerly named prerender.cloud from 2016 - 2022)
It's possible your IIS server may already have steps 1 and 2 and 4 mostly done already - in which case, just go to step 5.
- use the
Web Platform Installer
to install "URL Rewrite" (see more here if having problems) - use the
Web Platform Installer
to install "Application Request Routing" - restart IIS entirely
- create a file (if it doesn't already exist) named
web.config
and put it in the root of the directory serving your website - add a server variable for
HTTP_X_PRERENDER_TOKEN
(see screenshot below) - modify web.config
- add your Headless-Render-API.com API token
- hardcode the protocol in the
url
attr of the<action type="Rewrite" />
tag to be (http or https) for your site