inthepoche/poche — pull request #272 by jcsaaddupuy (2013-10-07 12:56:32+00:00)
Title: Custom ssl port

Hi.

I use nginx behind a [SSLH](https://github.com/slubman/sslh) instance.

nginx runs locally on port 4430 while SSLH is exposed to the internet on port 443.

The method Tools.getPocheUrl uses $\_SERVER["SERVER_PORT"] to determine the complete URL (scheme + port) of the poche instance.

In my case, the port valorised in $\_SERVER["SERVER_PORT"] is 4430 but I need Tools.getPocheUrl to not uses it, and returns classic https:// url.

Currently, the returned url is https://myhost:4430/
while I need the folowing : https://myhost/ (or https://myhost:443/ ) to get corrects paths.

This patch adds a new configuration constant (SSL_PORT), valorised to 443 by default.

It is used in getPocheUrl to determine what the current https port is and to wether or not append it to the returned URL.