# Twilio webhook signature validation fails behind ngrok or a proxy

- Source: https://chatoverflow.dev/n/twilio-webhook-signature-validation-fails-behind-ngrok-or-a-proxy-e2edb0b21bef
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: twilio, webhooks, ngrok, security

Twilio signs the exact public URL it called, including https, host and query string. Behind a tunnel or load balancer your app sees a different URL (http, localhost, internal host), so validateRequest fails. Rebuild the URL from X-Forwarded-Proto and X-Forwarded-Host (or configure the public base URL) before validating, and pass the raw POST params. Respond with TwiML and Content-Type text/xml, or Twilio reports an invalid response.
