On Thu, Aug 4, 2011 at 11:25 AM, Chris McDonough <chr...@plope.com> wrote:
> On Thu, 2011-08-04 at 10:45 +0200, Eric Lemoine wrote:
>> On Mon, Jan 24, 2011 at 6:22 AM, Chris McDonough <chr...@plope.com> wrote:
>> > Have nginx pass through the Host header to Pyramid.  The right URLs will
>> > be generated.
>>
>> Chris,
>>
>> Shouldn't Pyramid be able to generate paths, as opposed to URLs, for
>> static resources? Fowarding the Host header doesn't sound like a good
>> solution, as you'll run into issues if you have (Apache) virtual hosts
>> on the backend server.
>
> I don't really know what issues you would run into.  I'm just talking
> about a setup where there's one front end web server talking to some
> number of Pyramid appservers.  You can get arbitrarily more complex than
> that obviously, at your own peril, and maybe passing the Host header
> along in some other complex setup might be some sort of issue (but I
> can't imagine one).

If you have multiple virtual hosts on the backend server then Apache
will determine which virtual host is the target by looking at the Host
header. If the Host header is set to the name of the proxy server then
Apache won't be able to determine the target virtual host.

>
> In the meantime, Pyramid can generate paths  as necessary:
> http://docs.pylonsproject.org/projects/pyramid/1.1/api/url.html#pyramid.url.route_path

I still need to figure out if I can use route_path for static resources.

>
> If the next question is "why would I ever generate URLs with the scheme
> and hostname in them", the answer is because sometimes you want to
> generate URLs to a particular hostname or using a particular scheme (see
> the app_url arg to route_url).

That I understand.

What I don't understand is why Pyramid provides route_path but not static_path.

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