Re: How can I tell if a request was proxy-passed form an SSL server?

2002-11-14 Thread Carolyn Hicks
On Thu, Nov 14, 2002 at 12:45:52PM -0500, John Siracusa wrote:
> Assume I have a front-end (non-mod_perl) proxy server that supports both
> HTTP and HTTPS.  I want to know, from within my Perl code on the back-end
> (HTTP-only) mod_perl server, if the current request was ProxyPass-ed to me
> based on an original HTTP or HTTPS request from the user.
> 
> There doesn't appear to be a way to add headers to the proxy request on a
> per-virtual-host basis using mod_proxy, and I don't see any other headers
> that I can use to distinguish between an HTTP or HTTPS front-end server.
> Any ideas?

If you can proxy-pass HTTP and HTTPS requests to different ports on the
backend server, you just need to check which port the backend is listening
on to tell if the request came through SSL or not.

http://perl.apache.org/docs/1.0/guide/config.html#Knowing_the_proxy_pass_ed_Connection_Type

-carolyn



Re: How can I tell if a request was proxy-passed form an SSL server?

2002-11-14 Thread Marcin Kasperski
John Siracusa <[EMAIL PROTECTED]> writes:

> Assume I have a front-end (non-mod_perl) proxy server that supports both
> HTTP and HTTPS.  I want to know, from within my Perl code on the back-end
> (HTTP-only) mod_perl server, if the current request was ProxyPass-ed to me
> based on an original HTTP or HTTPS request from the user.
> 
> There doesn't appear to be a way to add headers to the proxy request on a
> per-virtual-host basis using mod_proxy, and I don't see any other headers
> that I can use to distinguish between an HTTP or HTTPS front-end server.
> Any ideas?

What about the simple manual solution: frontend server proxies 
/some/url to /http/some/url on backend for HTTP and to /https/some/url 
on backend for HTTPS. Or something similar...

-- 
( Marcin Kasperski   | Communication takes place between people, documents   )
( http://www.mk.w.pl |are secondary. (Booch) )
()
( Moje prywatne strony: http://www.kasperski.prv.pl  )



Re: How can I tell if a request was proxy-passed form an SSL server?

2002-11-14 Thread Randy Kobes
On Thu, 14 Nov 2002, John Siracusa wrote:

> On 11/14/02 2:12 PM, Randy Kobes wrote:
> > 
> > If your front-end proxy server has 'ProxyVia on' enabled, a Via
> > header would get sent.  According to rfc2068, the protocol name
> > should, and port may, be supplied in this header if these aren't
> > the defaults - would this be enough to enable your mod_perl
> > server to distinguish between an HTTP or HTTPS request?
> 
> I tried turning on ProxyVia, but all I got was the HTTP
> protocol version ("1.1") and the host ("www.foo.com"), but no
> scheme string (e.g. "http://"; or "https://";)

Were these from requests you know were made using https? My
reading of the Via header was that the protocol name is optional
only if it is HTTP, implying that if it's not given, you can
assume it's HTTP. Perhaps less useful, if the port is not given,
it may be assumed that the default port is used.

-- 
best regards,
randy





Re: How can I tell if a request was proxy-passed form an SSL server?

2002-11-14 Thread Randy Kobes
On Thu, 14 Nov 2002, John Siracusa wrote:

> Assume I have a front-end (non-mod_perl) proxy server that
> supports both HTTP and HTTPS.  I want to know, from within my
> Perl code on the back-end (HTTP-only) mod_perl server, if the
> current request was ProxyPass-ed to me based on an original
> HTTP or HTTPS request from the user.
> 
> There doesn't appear to be a way to add headers to the proxy
> request on a per-virtual-host basis using mod_proxy, and I
> don't see any other headers that I can use to distinguish
> between an HTTP or HTTPS front-end server. Any ideas?

If your front-end proxy server has 'ProxyVia on' enabled, a Via
header would get sent.  According to rfc2068, the protocol name
should, and port may, be supplied in this header if these aren't
the defaults - would this be enough to enable your mod_perl
server to distinguish between an HTTP or HTTPS request?

-- 
best regards,
randy kobes