Skip to main content

[PHP] Why does Sentry report my HTTPS URLs on port 80?

Issue

When I view my issues in Sentry, the request URL always shows port 80 even though my site uses HTTPS on port 443. My app runs behind a reverse proxy or load balancer that terminates TLS.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • All PHP SDKs

Symptoms

  • Running behind a reverse proxy or load balancer.

Resolution

When your app runs behind a proxy or load balancer that terminates HTTPS, the proxy handles the HTTPS connection on port 443 and forwards the request to your server as plain HTTP on port 80. The Sentry SDK builds the URL from what your application receives, so it reports HTTP on port 80.

To report the correct scheme and port:

  • Confirm your proxy or load balancer forwards the original protocol, for example through the X-Forwarded-Proto header.

  • Configure your application or framework to trust the proxy so it reads X-Forwarded-Proto and X-Forwarded-Port (for example, a trusted proxies setting).

  • Trigger a new event and confirm the URL shows HTTPS on port 443.

This is expected behavior driven by your infrastructure, not a Sentry defect.

Did this answer your question?