Enhance Twilio Call Provider and Nginx Configuration

- Updated TwilioCallProvider to support X-Forwarded-Proto and X-Forwarded-Host headers for improved webhook signature validation when behind proxies.
- Enabled trust proxy in StartServer to ensure correct interpretation of forwarded headers.
- Removed outdated incoming call policy documentation.
- Added Nginx configuration to handle X-Forwarded-Proto and X-Forwarded-Host headers, ensuring proper proxy behavior and preventing crashes when services are unavailable.
This commit is contained in:
Nawaz Dhandala
2026-01-17 21:18:27 +00:00
parent ea47d2bd2c
commit e0a9ab8cfb
6 changed files with 30 additions and 1330 deletions

View File

@@ -545,12 +545,19 @@ ${PROVISION_SSL_CERTIFICATE_KEY_DIRECTIVE}
}
location /notification {
# This is for nginx not to crash when service is not available.
# This is for nginx not to crash when service is not available.
resolver 127.0.0.1 valid=30s;
proxy_set_header Host $host;
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;
# Use upstream X-Forwarded-Proto if available (for webhook signature validation behind proxies like ngrok)
# Falls back to $scheme if not set
set $forwarded_proto $http_x_forwarded_proto;
if ($forwarded_proto = '') {
set $forwarded_proto $scheme;
}
proxy_set_header X-Forwarded-Proto $forwarded_proto;
proxy_set_header X-Forwarded-Host $host;
# enable WebSockets (for ws://sockjs not connected error in the accounts source: https://stackoverflow.com/questions/41381444/websocket-connection-failed-error-during-websocket-handshake-unexpected-respon)
proxy_http_version 1.1;