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).

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

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).  See the "_app_url" argument to
http://docs.pylonsproject.org/projects/pyramid/1.1/api/url.html#pyramid.url.route_url

- C


-- 
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