Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
HTTPS through reverse proxy
nicoduck #1
Member since May 2007 · 9 posts
Group memberships: Members
Show profile · Link to this post
Subject: HTTPS through reverse proxy
Hi,

I have a reverse proxy for https in front of my UNB installation. Since the header $_SERVER['HTTPS'] is not set, UNB returns http:// urls, instead of https://
Replacing
if ($_SERVER['HTTPS'] == 'on')
with 
if ($_SERVER['HTTPS'] == 'on' or $_SERVER['HTTP_X_FORWARDED_PROTO']=='https')
in unb_lib/common_out.lib.php solves that problem.

Would it be better to manipulate the $_SERVER['HTTPS'] variable in one of the include files with
if ($_SERVER['HTTP_X_FORWARDED_PROTO']=='https') $_SERVER['HTTPS'] == 'on';
?

If it possible to include that enhancement in one of the further releases?

nico
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I think it looks better to check the other value instead of manipulating the original value.

Can you provide me a link to some documentation or standards that defines that HTTP_X_FORWARDED_PROTO value? I couldn't find it. If it's no common variable, I'd consider it your local customisation and not a default UNB feature. Otherwise if it's more widespread, I may include it in the core.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 144.6 ms (95.9 ms) · 47 database queries in 111.8 ms
Current time: 2013-05-18, 22:12:44 (UTC +02:00)