On Mon, Aug 8, 2011 at 7:15 AM, Chris McDonough <chr...@plope.com> wrote:
> On Mon, 2011-08-08 at 07:04 +0200, Eric Lemoine wrote:
>> On Mon, Aug 8, 2011 at 6:49 AM, Chris McDonough <chr...@plope.com> wrote:
>> > On Mon, 2011-08-08 at 06:38 +0200, Eric Lemoine wrote:
>> >> >> Right. I'd rather apply this: "don't generate fully-qualified URLs in
>> >> >> your web apps, or you may have trouble running them behind proxies".
>> >> >
>> >> > You're eventually going to run into situations with middleware that
>> >> > unconditionally generates fully qualified URLs where I believe you're
>> >> > going to need to modify that to "always set ProxyPreserveHost On".  But
>> >> > until then, you can try to ignore it by generating only paths, although
>> >> > I don't think that makes much sense given that it's so easy to turn on.
>> >>
>> >> Got you.
>> >>
>> >> Also, FWIW, when relying on ProxyPreserveHost the backend must be
>> >> aware of the proxy, as it needs a ServerName or ServerAlias
>> >> referencing the proxy. This might be a management hassle in some
>> >> situations.
>> >
>> > I don't think so, unless you're defining "backend" differently than I
>> > am.  The point of passing along the Host header is so that things behind
>> > the proxy don't need to know or care about the proxy.
>>
>> Here's what I have for the Apache config of the backend:
>>
>> # file managed by puppet
>> <VirtualHost *:80>
>>   ServerName foo
>>
>>   ServerAlias foo.dmz.camptocamp.com
>>   ServerAlias foo.camptocamp.com   # <- proxy hostname
>>
>>   ...
>> </VirtualHost>
>>
>> Without the second ServerAlias statement incoming requests with
>> Host:foo.camptocamp.com lead to 404's from Apache.
>
> OK, so you're referring to Apache as "the backend"?  It's pretty hard to
> talk about this without knowing your setup.  I guess you have like a
> Varnish server or something in front of Apache as "the proxy"?  If so, I
> guess I'd wonder why, unless it's a corporate guideline constraint or
> something similar, or if you're actually doing caching in the proxy (the
> Apache proxy isn't very good at caching).
>
> I often have the luxury of just setting up a single Apache server as the
> "frontend"; clients talk directly to it and it talks directly to the
> Pyramid server(s) on the backend (these are running paste.httpserver).
> There's no separate proxy in that setup, and there's no HTTP caching
> going on (except on the client).  Your setup is more complex, I take it.

Sorry for not being clear about my setup. I have Apache+mod_proxy on
the proxy, and Apache+mod_wsgi on the backend. And yes, this setup is
related to corporate guideline constraints for our "demo" servers.

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to