Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How to detect the request protocol (HTTP or HTTPS) in a App Platform's Web Service Component?
App Platform reverse proxies the requests to the Components but always to the same port, making it impossible to differ the request’s protocol used by just checking whether was the port 443 or 80 that received the request.
For exemple, NGINX allows us to use the
Forwarded header to carry that information through a proxy thus letting or application check the protocol originally used to make the request.
Others also work with the
X-Forwarded-Proto header with some other headers to carry that information through a proxy, but this one doesn’t seem to work.
That said, how could I check via PHP inside my component (running NGINX + PHP-FPM) which was the protocol originally used to make the request?