Fix support of the X-Forwarded-Proto header for fastcgi.

Implement the suggested solution for #165