I have the following setup:
NGINX -> Apache -> PHP scripts
Apache is serving the PHP scripts and NGINX is setup as a reverse proxy. Now my app runs both through HTTP and HTTPS and I need to generate some <script src="", another things depending if I am on HTTP or HTTPS. The sysadmin said the he has setup a custom header from NGINX to be sent to Apache so I can know in my script when I am on HTTP or HTTPS. The issue is that print_r($_SERVER) and also apache_request_headers() doesn’t display this custom header.
How can I check the header?
If
apache_request_headers()doesn’t show your custom header but it shows you the others, chances are it wasn’t sent – I have successfully use it to get custom headers before. You should double check that the custom header is being added as you think it is (especially since it sounds like it wasn’t you that configured this header), using Wireshark or similar.