Documentation Index
Fetch the complete documentation index at: https://docs.postmetric.io/llms.txt
Use this file to discover all available pages before exploring further.
Proxy PostMetric through your Nginx server.
Setup
Step 1: Add proxy configuration
Add this to your Nginx configuration:
location /api/track.js {
proxy_pass https://your-postmetric-domain.com/api/track.js;
proxy_set_header Host your-postmetric-domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Set content type
add_header Content-Type application/javascript;
}
location /api/track {
proxy_pass https://your-postmetric-domain.com/api/track;
proxy_set_header Host your-postmetric-domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Step 2: Reload Nginx
sudo nginx -t
sudo systemctl reload nginx
Step 3: Update tracking script URL
Update your tracking script to use your domain:
<script src="https://your-domain.com/api/track.js?site=YOUR_TRACKING_CODE"></script>
Next steps
Proxy setup guide
Learn more about proxying PostMetric