HTTP headers have the format:
HTTP 1.1
something
somethingelse
Using a single line feed after each line, and a double line feed at the bottom. So once you know what the forwarded header is you can build it and pass it to the server as long as it comes after the HTTP line and before the double line feed.
PHP takes these headers and builds the HTTP_* variables from them.