I am using Oxwall on a machine with Apache serving the content with http. However at the perimeter of our network we run a reverse proxy for all incoming things. This does filtering, SSL termination (secure storage for the certificate) and multiplexing the available addresses as well as redirecting http to https traffic.
So I am running oxwall on port 80 with no http, but the user will see it on 443 with https.
This is not such a uncommon scenario, however I have'nt been able to find a reference to it and how to set it up. I got it working, but I wonder why I need to make code changes:
a) I configure the https-link as the home URL
b) I added the following lines to ow_core/request.php isSsl() to recognize connections coming from the proxy as beeing secure (and in turn avoiding mixed content warnings):
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $_SERVER['HTTPS']='on'; $isHttps = true; } else ...There is a check for "HTTPS" property but it is not set. Maybe I can instead of making code changes somehow configure apache or php to do that? If not, would it make sense to offer this as a patch (make it configurable "DETECT_SSL=always|never|auto" where the default is never and auto would use the above code?