Issue with SetEnvIf

Discussion in 'Apache Migration/Compatibility' started by aisonet, Nov 29, 2013.

  1. aisonet

    aisonet Member

    m running the latest version of Litespeed Web Server Enterprise v4.2.6 and I have a apache .htaccess file, a load balancer in front of a litespeed cluster and im running magento. Sites SSLs are accelerated at the load balancer and so when magento redirects to HTTPs it needs to think its already there when in reality the SSL connection is terminated at the load balancers and from the LBs to litespeed its only HTTP. To do this I need the following to work in the .htaccess file for litespeed:

    SetEnvIf X-Forwarded-Proto https HTTPS=on

    Currently when litespeed is enabled, magento just does a 301 redirect forever since it doesnt see its in HTTPS via the X-Forwarded-Proto header the Load Balancers are sending. I need this or a way to do the same in litespeed. I tried the following but it didnt work.

    RewriteCond %{HTTP:X-Forwarded-Proto} ^https$
    RewriteRule .* - [E=HTTPS:eek:n]
  2. NiteWave

    NiteWave Administrator

    Sorry this looks wrong.

    not working should due to HTTPS:eek:n/off can't be overridden.

    I did a quick search just now, you may need modify the php code:
    Last edited: Nov 30, 2013
  3. aisonet

    aisonet Member

    Can you add the ability to override it via such a line, as its important to have it in the .htaccess file then in the code directly due to code updates or even other software behind SSL load babalancers lacners that are not magento.
  4. aisonet

    aisonet Member

    Also the php code you gave us works for checkout, but breaks the login to the admin area and the client couldnt login to the admin area, so the only work around is the apache SetEnvIf.
  5. aisonet

    aisonet Member

    When will this get fixed? This is really important
    Last edited: Jan 25, 2014
  6. aisonet

    aisonet Member

    Has this been fixed in the latest update?
  7. mistwang

    mistwang LiteSpeed Staff

    5.0.x supports SetEnvIf directives in .htaccess. If it works with Apache, it should work with litespeed.

Share This Page