Proxy Admaxxer Through Vercel Rewrites

Vercel's built-in rewrite engine lets you forward specific URL paths on your deployment to a different upstream — without writing any server code. Two entries in vercel.json are all you need to proxy the Admaxxer pixel and event endpoint through your own domain.

Why Proxy?

Prerequisites

Step 1 — Edit vercel.json

Open (or create) vercel.json in your project root. Add a rewrites array:

{
  "rewrites": [
    {
      "source": "/js/script.js",
      "destination": "https://admaxxer.com/js/script.js"
    },
    {
      "source": "/api/event/:path*",
      "destination": "https://admaxxer.com/api/event/:path*"
    }
  ]
}

If you already have a rewrites array, append both objects to it. The order matters — Vercel applies rewrites top to bottom; put the pixel entries before any catch-all rewrite you may have.

Step 2 — Deploy

Commit the change and push. Vercel will redeploy automatically. The two paths are now live within seconds of the deployment completing.

git add vercel.json
git commit -m "proxy admaxxer pixel through own domain"
git push

Step 3 — Update Admaxxer Snippet

In Admaxxer go to Connections › Install, enable Custom proxy domain, and enter your Vercel deployment domain (e.g. https://yourdomain.com). Save. The generated snippet will now reference yourdomain.com/js/script.js and yourdomain.com/api/event.

Step 4 — Test

After deploying, verify the proxy works from the command line:

curl -I https://yourdomain.com/js/script.js

You should see HTTP/2 200 and content-type: application/javascript. Then fire a test event from your browser and confirm it appears in the Admaxxer Live Events tab.

Framework Notes

If you are using Next.js, Nuxt, or another framework deployed on Vercel, the vercel.json rewrites approach still works, but there is a framework-native alternative that avoids shipping the config file. See the Next.js proxy guide for next.config.js rewrites, or the Nuxt guide for Nitro route rules.

Troubleshooting

Rollback

Remove the two objects from the rewrites array and redeploy. In Admaxxer, disable the custom proxy domain to revert the snippet. The change takes effect on the next deployment.

Other Proxy Guides

Cloudflare · Next.js · Nuxt · Netlify · WordPress · Apache · NGINX

See also: Connections › Install for the base snippet.