On Jan 22, 2008 7:04 PM, Cliff Wells <[EMAIL PROTECTED]> wrote:
>
>
> On Tue, 2008-01-22 at 11:11 -0800, Matt Haggard wrote:
>
> > I've been developing without the filter option, and now that I have
> > it, my hard-coded image paths no longer work.  (e.g. they're looking
> > at http://127.0.0.1:5000/images/something.gif when they should be
> > looking at http://127.0.0.1:5000/myapp/images/something.gif )
>
> Why not just use a webserver (Nginx, Apache, etc) to serve them?  Then
> you simply setup a handler for that location (/images) and your problem
> goes away..  You get the added benefit of things getting significantly
> faster.
>
> I strongly suspect (although I haven't tested) that using Pylons to
> serve static files isn't going to deploy well in the real world (unless
> you are expecting very little traffic).

You'll have to set up a handler for each file/directory in public if you want to
do this, or put everything in a subdirectory of public which will appear in the
URL (public/static/images -> /static/images).  Unless there's a way to make
Apache fall back to the application if a static file doesn't exist.

It's not well documented how to do this.  You're not actually setting
up a handler for the static files.  You're setting up a handler for
the Pylons app and then disabling it for certain sub-URLs.  With
mod_proxy it would be:

DocumentRoot   /myapp/myapp/public
ProxyPass        /             http://127.0.0.1:8080/
ProxyPass        /images   !

With mod_scgi you'd do something like:

<Location /images>
    SCGIHandler Off
</Location>

Each handler has a different way to disable itself.  There may be some
that can't be disabled at all.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to