createProxy(): the site secret and the visitor’s IP. Read how the proxy works first if you have not set one up before.
Replace YOUR_SITE_ID and YOUR_PROXY_PATH with your own values. Site settings › Installation shows both, with this code already filled in. Generate the site secret there too.
1
Create the site secret
nginx reads no environment variables, so the secret goes into highseat-proxy.conf in place of hs_secret_… Keep the file out of version control.
.env
2
Add the proxy locations
In your server block.
3
Add the headers they share
Beside your nginx config.
highseat-proxy.conf
4
Load the tracker from the path
In the
<head> of every page, in place of the tag that loads from Highseat.Keep the secret out of version control
nginx reads no environment variables, so the secret sits inhighseat-proxy.conf as plain text. Keep that file out of your repository.
Behind Cloudflare
$remote_addr is the address that connected to nginx. Behind a proxied Cloudflare record, that is a Cloudflare address. Set X-Hs-Client-Ip to $http_cf_connecting_ip instead: Cloudflare passes the visitor’s IP in that header.
Visitor headers stay on your site
highseat-proxy.conf clears Cookie, Authorization and Referer on both locations. nginx forwards the visitor’s other headers. If your site signs users in with another header, clear it the same way, with a proxy_set_header line and an empty value.
Hosts without a server
A static host with no server and no functions, such as GitHub Pages or S3, cannot run a proxy. Load the tracker fromcdn.highseat.com with the standard install.