Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: Floyd-ATC på 29. Oktober 2015, 20:41 pm

Tittel: SSL offloading an SMF forum
Skrevet av: Floyd-ATC29. Oktober 2015, 20:41 pm
I have experimented a bit with using my Linux based keepalived/haproxy cluster to do SSL offloading for various web sites of mine and found SMF a bit difficult to work with because it seems to insist on refering to itself using the absolute URL beginning with "http://" (or "https://" if you change board's URL).

Unfortunately, if you either want to make the forum protocol independent or you want to use SSL offloading (which basically makes the web server unaware of the fact that clients use HTTPS) those self-referencing links become a problem.

Playing around with the admin settings solved nothing and the few discussions I found on the topic made me question if it was possible at all. However, I found a dead simple solution which involves just three easy steps that seem to work perfectly:

E.g. to fix my forum I used the following queries:
Kode: [Velg]
UPDATE settings SET value=REPLACE(value,'http://forums.atc.no','') WHERE value LIKE 'http://forums.atc.no%';
UPDATE themes SET value=REPLACE(value,'http://forums.atc.no','') WHERE value LIKE 'http://forums.atc.no%';

...and *poof* now my users can either keep using HTTP or they can use HTTPS which gets offloaded by my load balancing cluster. I see no reason why this should not work just fine with any other SSL gateway as well.

I really can't understand why SMF was designed with absolute URLs to begin with.