Hello!

There is needed set up url for auto-redirects in config:

ns_section "ns/server/${servername}/module/nssock"
;# Port for HTTP (typically 80)
ns_param   port            $httpport 
;# This is not the same as your hostname
ns_param   hostname        $hostname 
;# This is not the same as your host addr
ns_param   address         $address 
;# URL for auto-redirects (trailing slash)
ns_param   location        "https://offline.mts.mobigroup.ru"; 

And ns_returnredirect is using "https://offline.mts.mobigroup.ru"; as protocol 
and host name and port path for all redirects. But for working by http and 
https protocols at same time and with DNS aliases is required wrapper for 
ns_returnredirect:

proc http_redirect {url {}} {
        ns_returnredirect [::http::location $url]
        ns_adp_return
}

proc http_location {url {}} {
        # reverse-proxy must add X-Forwarded-Proto=https for SSL mode
        if {[string equal [ns_set get [ns_conn headers] "X-Forwarded-Proto"] 
"https"]} {
                set protocol https
        } else {
                set protocol http
        }
        return "$protocol://[ns_set get [ns_conn headers] Host]$url"
}

Is it possible to decide this problem more simple? (For non-standart port is 
similar problem).

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.

Reply via email to