Re: SetEnv HTTPS on... not working.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have SSL offloader, what checks wheather user came using HTTP or HTTPS (sends accordingly header.)

As I want it to be transparent to application and available to .htaccess, I use apaches values. I want to overwrite them.


Br,
Margus




On 12/10/2010 10:27 AM, Igor GaliÄ wrote:
----- "Mxrgus Pxrt"<margus@xxxxxxxx>  wrote:

Hello!

I have SSL offloader sending HTTPS header to backend server.

In backend server I have:
SetEnvIf HTTPS "(..*)" HTTPS=$1
RewriteCond %{HTTPS} !=on
RewriteRule (.*)      https://%{HTTP_HOST}%{REQUEST_URI}?%{HTTPS}
[L,R=301]

And it causes infinite redirect loop (to https://server/url/?off),
because env value HTTPS is "off" for RewriteCond.


I also tried:
SetEnv HTTPS on
RewriteCond %{HTTPS} !=on
RewriteRule (.*)      https://%{HTTP_HOST}%{REQUEST_URI}?%{HTTPS}
[L,R=301]

But it also created infinite loop - HTTPS was shown to be off.
http://wiki.apache.org/httpd/RewriteLooping

If I watch HTTPS env value from some script (eg PHP $_SERVER['HTTPS']
is
"on"), then from there it is shown "on".



I got it woking so:
RewriteCond %{HTTP:HTTPS} !=on
RewriteRule (.*)      https://%{HTTP_HOST}%{REQUEST_URI}?%{HTTPS}
[L,R=301]

But I would like, if it would not check header, but env value. Could
anyone clarify, why it works so, or throw some good link please?

Somehow I fail to see what problem you're trying to solve.

Best regards,
Margus PÃrt
i



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux