<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>HTTPS on load balancer</title>
        <description> We&amp;#039;re terminating SSL encryption on the load balancer, communication between the LB and the web servers is unencrypted. The LB adds a HTTP header &amp;quot;isSSL: true&amp;quot; on imcoming HTTPS requests. To make Phorum work in this setup, I added a file include/phorum_get_protocol.php and made a few changes to common.php and include/phorum_get_url.php.

I&amp;#039;ld like to append the files here, but this doesn&amp;#039;t seem to be possible, so I put it this way:

get_protocol. php:

Language: PHP&amp;lt;?php
&amp;nbsp;
$allheaders= getallheaders&amp;#40;&amp;#41;;
if &amp;#40;isset&amp;#40;$allheaders&amp;#123;&#039;;isSSL&#039;;&amp;#125;&amp;#41; and $allheaders&amp;#123;&#039;;isSSL&#039;;&amp;#125; == &#039;;true&#039;;&amp;#41; &amp;#123;
   $protocol = &#039;;https&#039;;;
&amp;#125;
else &amp;#123;
 $protocol = &#039;;http&#039;;;
&amp;#125;
?&amp;gt;


In common.php, I added 

Language: PHPrequire_once&amp;#40;&amp;quot;include/phorum_get_protocol.php&amp;quot;&amp;#41;;

after the other includes and 

Language: PHP$PHORUM&amp;#91;&#039;;http_path&#039;;&amp;#93; = preg_replace &amp;#40;&amp;quot;!^https?!&amp;quot; , $protocol , $PHORUM&amp;#91;&#039;;http_path&#039;;&amp;#93;&amp;#41;;

after 

Language: PHPphorum_db_load_settings&amp;#40;&amp;#41;;

and in phorum_get_url.php I put

Language: PHPglobal $protocol;
 $url= preg_replace &amp;#40;&amp;quot;!^https?!&amp;quot; , $protocol , $url&amp;#41;;

just before 

Language: PHPreturn $url;

in each of the functions phorum_get_url,  phorum_get_url_no_uri_auth and  phorum_get_current_url.

This refers to version 5.2.20.

Would somebody integrate that in proper form in Phorum, perhaps as a module? The name and value of the header sent by the LB should probably be configurable.</description>
        <link>https://www.phorum.org/phorum5/read.php?20,161398,161398#msg-161398</link>
        <lastBuildDate>Sun, 08 Mar 2026 13:46:58 -0400</lastBuildDate>
        <generator>Phorum 5.2.22</generator>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?20,161398,161415#msg-161415</guid>
            <title>Re: HTTPS on load balancer</title>
            <link>https://www.phorum.org/phorum5/read.php?20,161398,161415#msg-161415</link>
            <description><![CDATA[ If you read my first posting, you should notice that this is a request that somebody implements it correctly. I just put my changes there as hints how it could be done.]]></description>
            <dc:creator>Schurki</dc:creator>
            <category>Phorum Hack/Mod Requests</category>
            <pubDate>Sat, 10 Dec 2016 15:54:18 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?20,161398,161404#msg-161404</guid>
            <title>Re: HTTPS on load balancer</title>
            <link>https://www.phorum.org/phorum5/read.php?20,161398,161404#msg-161404</link>
            <description><![CDATA[ Hi Schurki,<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong>Schurki</strong><br />
I&#039;ve tried that module first, it&#039;s not working.</div></blockquote>
<br />
Nevertheless you should implement your needs as a new module (perhaps based on the Automatic HTTP Path Module) instead of patching the Phorum core...<br />
<br />
Regards<br />
Oliver]]></description>
            <dc:creator>Oliver Riesen-Mallmann</dc:creator>
            <category>Phorum Hack/Mod Requests</category>
            <pubDate>Wed, 07 Dec 2016 07:17:59 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?20,161398,161401#msg-161401</guid>
            <title>Re: HTTPS on load balancer</title>
            <link>https://www.phorum.org/phorum5/read.php?20,161398,161401#msg-161401</link>
            <description><![CDATA[ I&#039;ve tried that module first, it&#039;s not working. In my setup, the user@browser kann choose if he wants to use HTTPS or HTTP, but  the LB forwards all incoming requests, even HTTPS, as HTTP to the web servers. Additionally, Phorum ist accessed through 2 different domains, one accessible only internally for admin tasks, and one external, where admin stuff is blocked by server config. The configured http_path points to the external domain.]]></description>
            <dc:creator>Schurki</dc:creator>
            <category>Phorum Hack/Mod Requests</category>
            <pubDate>Thu, 01 Dec 2016 17:32:08 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?20,161398,161399#msg-161399</guid>
            <title>Re: HTTPS on load balancer</title>
            <link>https://www.phorum.org/phorum5/read.php?20,161398,161399#msg-161399</link>
            <description><![CDATA[ I am not sure exactly what you want between LB and Phorum, but this works for most who want https between the browser and Phorum, or http between the browser and Phorum. It should work with any passed URL regardless of source.<br />
<br />
<br />
Automatic HTTP Path (version 1.0.9)<br />
This module automatically sets the HTTP Path configuration option, <span style="color:#FF0000">based on the active<br />
URL.</span> This can be useful if for some reason you run one Phorum install under various host<br />
names and/or directories (e.g. a Phorum on a private space intranet server that is also<br />
accessible through a public URL or a server that has to be accessible on both an http://<br />
and https:// URL).<br />
<br />
<a href="http://www.phorum.org/phorum5/read.php?62,125914,125914#msg-125914" target="_blank" >Automatic HTTP Path</a><br />
<br />
<br />
In the Admin under General Settings, File/Path Settings... you may need to change this, not sure...]]></description>
            <dc:creator>Scott Finegan</dc:creator>
            <category>Phorum Hack/Mod Requests</category>
            <pubDate>Thu, 01 Dec 2016 15:55:16 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/phorum5/read.php?20,161398,161398#msg-161398</guid>
            <title>HTTPS on load balancer</title>
            <link>https://www.phorum.org/phorum5/read.php?20,161398,161398#msg-161398</link>
            <description><![CDATA[ We&#039;re terminating SSL encryption on the load balancer, communication between the LB and the web servers is unencrypted. The LB adds a HTTP header &quot;isSSL: true&quot; on imcoming HTTPS requests. To make Phorum work in this setup, I added a file include/phorum_get_protocol.php and made a few changes to common.php and include/phorum_get_url.php.<br />
<br />
I&#039;ld like to append the files here, but this doesn&#039;t seem to be possible, so I put it this way:<br />
<br />
get_protocol. php:<br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div><span class="kw2">&lt;?php</span>
&nbsp;
<span class="re0">$allheaders</span><span class="sy0">=</span> <a href="http://www.php.net/getallheaders"><span class="kw3">getallheaders</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$allheaders</span><span class="br0">&#123;</span><span class="st_h">';isSSL'</span><span class="sy0">;</span><span class="br0">&#125;</span><span class="br0">&#41;</span> and <span class="re0">$allheaders</span><span class="br0">&#123;</span><span class="st_h">';isSSL'</span><span class="sy0">;</span><span class="br0">&#125;</span> <span class="sy0">==</span> <span class="st_h">';true'</span><span class="sy0">;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
   <span class="re0">$protocol</span> <span class="sy0">=</span> <span class="st_h">';https'</span><span class="sy0">;;</span>
<span class="br0">&#125;</span>
<span class="kw1">else</span> <span class="br0">&#123;</span>
 <span class="re0">$protocol</span> <span class="sy0">=</span> <span class="st_h">';http'</span><span class="sy0">;;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span></pre>
<br />
<br />
In common.php, I added <br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div><span class="kw1">require_once</span><span class="br0">&#40;</span><span class="st0">&quot;include/phorum_get_protocol.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
<br />
after the other includes and <br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div><span class="re0">$PHORUM</span><span class="br0">&#91;</span><span class="st_h">';http_path'</span><span class="sy0">;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a> <span class="br0">&#40;</span><span class="st0">&quot;!^https?!&quot;</span> <span class="sy0">,</span> <span class="re0">$protocol</span> <span class="sy0">,</span> <span class="re0">$PHORUM</span><span class="br0">&#91;</span><span class="st_h">';http_path'</span><span class="sy0">;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
<br />
after <br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div>phorum_db_load_settings<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
<br />
and in phorum_get_url.php I put<br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div><span class="kw2">global</span> <span class="re0">$protocol</span><span class="sy0">;</span>
 <span class="re0">$url</span><span class="sy0">=</span> <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a> <span class="br0">&#40;</span><span class="st0">&quot;!^https?!&quot;</span> <span class="sy0">,</span> <span class="re0">$protocol</span> <span class="sy0">,</span> <span class="re0">$url</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
<br />
just before <br />
<br />
<pre class="php bbcode_geshi"><div class="head">Language: PHP</div><span class="kw1">return</span> <span class="re0">$url</span><span class="sy0">;</span></pre>
<br />
in each of the functions phorum_get_url,  phorum_get_url_no_uri_auth and  phorum_get_current_url.<br />
<br />
This refers to version 5.2.20.<br />
<br />
Would somebody integrate that in proper form in Phorum, perhaps as a module? The name and value of the header sent by the LB should probably be configurable.]]></description>
            <dc:creator>Schurki</dc:creator>
            <category>Phorum Hack/Mod Requests</category>
            <pubDate>Thu, 01 Dec 2016 13:28:00 -0500</pubDate>
        </item>
    </channel>
</rss>
