Skip to content

Nginx

Two location blocks and off you go.

  1. Add these two blocks to your server

    The first caches the key for a day, same as we do. The second forwards events with the real IP.

    location = /js/llave.js {
        proxy_pass         https://pisi.to/js/llave.js;
        proxy_set_header   Host pisi.to;
        proxy_ssl_server_name on;
        proxy_cache_valid  200 24h;
    }
    
    location = /api/event {
        proxy_pass         https://pisi.to/api/event;
        proxy_set_header   Host pisi.to;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   User-Agent $http_user_agent;
        proxy_ssl_server_name on;
    }
    nginx
  2. Reload Nginx and point the script

    nginx -t to check the syntax, nginx -s reload to apply.

    <script defer
            data-domain="example.com"
            data-api="https://example.com/api/event"
            src="https://example.com/js/llave.js"></script>
    html

Check that it works

Open your site in a new tab and watch the dashboard: you should show up under "home right now" in under ten seconds. If you do not, run through the onboarding checklist.