I've run into similar problems where I had home-grown virtualhosting working
with some DAV stuff I was working on. The only way I could figure out how to
get the hostname was the same as yours. On the bright side, you could make a
nice little routine that tries to look at ns_conn hostname (or whatever it
is) and, only if it's blank, grab it from the headers.

I fiddled around with simulating requests from Telnet, and I think I
determined that the hostname was set only when you did something like:

GET http://hostname/blah/blah HTTP/1.0

But modern HTTP/1.1 requests only set them in the headers:

GET /blah/blah HTTP/1.1
Host: hostname

I agree, I felt a little 'dirty' grabbing the hostname out of there myself.

I should note as a caveat that I'm on an older version of aolserver than
everyone else (3.4ish or so), and I haven't touched most of that code in a
long time, so things might be different now.

On Tue, 4 May 2004 14:11:53 -0600, Ross Simpson <[EMAIL PROTECTED]> wrote:

>Hello,
>
>I'm working on a site that uses SSL, and want to redirect users who
>access the site via http to https.
>
>The way I've done this in the past is to check ns_conn driver, then
>redirect to a hardcoded URL.
>
>However, I would like to be able to do this independent of the system
>aolserver is running on -- e.g., have it work in both development and
>production environments.  Since requests in production may be coming
>from a load balancer, using the machine's hostname won't work.
>
>I've looked through the information available in ns_info and ns_conn,
>and the _only_ place I see the hostname that was actually in the
>original request is the Host header, available from ns_conn headers.
>I'd really rather not have to dip into the headers to get this.
>
>I'm sure other people have solved the problem.. how it this typically
>done?
>
>Thanks for any ideas :)
>Ross
>
>
>--
>AOLserver - http://www.aolserver.com/
>
>To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to