Alexey,

Looks great, you might also look at [ns_conn location] If any internal
Tcl code uses it to build url, they will stop working behind a proxy. 

Just one instance: sometimes it is useful to return basic style based
images via http, so image urls might need to be rewritten during an
https session. 

tom jackson

On Mon, 2009-05-04 at 12:43 +0400, Alexey Pechnikov wrote:
> Hello!
> 
> I did write the wrapper for AOL 4.5:
> 
> ns_ictl oncreate {
>     if {[info commands _ns_returnredirect] eq {}} {
>         rename ns_returnredirect _ns_returnredirect
>         proc ns_returnredirect {url} {
>             # reverse-proxy must add header "X-Forwarded-Proto: https"
>             # for SSL mode
>             # HAProxy: reqadd X-Forwarded-Proto:\ https
>             # Pound: AddHeader "X-Forwarded-Proto: https"
>             if {[string equal [ns_set get [ns_conn headers] 
> "X-Forwarded-Proto"] "https"]} {
>                 set proto https
>             } else {
>                 set proto http
>             }
>             _ns_returnredirect "$proto://[ns_set get [ns_conn headers] 
> Host]$url"
>         }
>     }
> }
> 
> This work fine for me.
> 
> Best regards, Alexey Pechnikov.
> http://pechnikov.tel/
> 
> 
> --
> AOLserver - http://www.aolserver.com/
> 
> To Remove yourself from this list, simply send an email to 
> <lists...@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field of your email blank.
> 


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to