CGI in Perl: how to access the original HTTP headers
14:32 12 Dec 2025

A simple proxy in Perl runs as a CGI on the webserver of my ISP. It's purpose is to forward https GET and POST to a http webserver running on my PC. With that https works without the need of any TLS certificate and domain on my PC.

It generally works, but the original headers can't be forwarded, because I have not found a method accessing them. I can only get them via %ENV, but then "Content-Type" becomes "CONTENT_TYPE", and that of course isn't recognized by the PC webserver.

Is there a way to access the original headers? I don't want to retranslate them to the original ones. There should be an easier way, but I found nothing on the web.

perl http header cgi