On Jul 8, 2011, at 6:06 PM, Bruno Rocha wrote:
> On Fri, Jul 8, 2011 at 8:01 PM, Jonathan Lundell <[email protected]> wrote:
> It depends on your configuration. If apache/nginx is handling static files 
> directly, then web2py never sees it. Otherwise it does.
> 
> question:
> i
> How is the best way for testing if nginx is really handling /static directly 
> and web2py is not being loaded for it?
> 
> may be:
> 
> if request.function == 'static':
>     #do something
> 
> then request some static files and watch if #something is processed?
> 
> or is there a better way?  
> 

That might be the easiest way, but not in an app, since static requests never 
get that far. Do something in the

                 if static_file:

clause in gluon.main.

It's possible that you could detect who's serving the file from the headers, 
too. Try turning nginx's handling of static files off and see if the response 
headers change.

Reply via email to