LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Ruby/Rails (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=20)
-   -   Add header when proxing (http://www.litespeedtech.com/support/forum/showthread.php?t=472)

zhesto 06-19-2006 06:43 PM

Add header when proxing
 
Hi,
I'm using litespeed-2.1.16 to proxy requests to backend web server (Ruby on Rails with Mongrel). When using HTTPS I need to add a special header to the request, so the backend server will understand that the initial request is over HTTPS. For example with pound reverse proxy (see http://mongrel.rubyforge.org/docs/pound.html ):
Code:

AddHeader "X-Forwarded-Proto: https"
For Apache:
Code:

RequestHeader set X_FORWARDED_PROTO 'https'
How to add such a header with LiteSpeed?

mistwang 06-19-2006 08:35 PM

That header will be added automatically by LSWS 2.1.17. The new release will be announced soon. Actaully, you can downalod it now.

zhesto 06-19-2006 10:55 PM

Quote:

Originally Posted by mistwang
That header will be added automatically by LSWS 2.1.17. The new release will be announced soon. Actaully, you can downalod it now.

Thank you very much. You made my day :) Just for the record (maybe can help somebody) - what I'm doing in the moment:
Code:

# app/controller/application.rb
def require_ssl
  env['HTTPS'] = 'on' unless (@request.ssl? or local_request?)
end

# app/controller/othercontroller.rb
before_filter :require_ssl
# or: before_filter :require_ssl, :only => [:some_action]
# or: before_filter :require_ssl, :except => [:some_action]



All times are GMT -7. The time now is 08:09 PM.