Welcome! Log In Create A New Profile

Advanced

Re: nginix not servic static content as part of page

Maxim Dounin
February 05, 2010 07:24AM
Hello!

On Fri, Feb 05, 2010 at 06:08:20AM -0500, JohnSchulze wrote:

> I have a Mongrel cluster behind nginx and am trying to get nginx
> to serve up the static contents of my site with the following
> rule (RESTful URLs):
>
> location / {
> if (-f $request_filename) { break; }
>
> if (!-f $request_filename) {
> proxy_pass http://mycluster$request_uri;
> break;
> }
> }
>
> When I load up a page which has images in it (referenced from
> /public/images) the requests for the images seem to hang forever
> (same goes for JS, CSS, etc). However, if I go straight to an
> image URL (right click, "view image") all the files are served
> as expected - and they continue to be served if i turn the
> Mongrel cluster off. So nginx can clearly see and access all the
> static files. Also, when looking in firebug while loading a page
> I can see that double requests are being made for some of the
> files (not always the same ones!) and that sometimes one of them
> is served correctly while the other request will hang
> indefinitely. Latency for content that does get served is also
> much worse than when pointing straight to a Mongrel instance.

Could you please provide nginx -V output, full config and debug
log for faulty request(s)? See here for instructions how to
obtain debug log:

http://nginx.org/en/docs/debugging_log.html

Note well: using try_files and not using dynamic hostname
resolution as suggested in previous reply is anyway preffered.
But config as shown in your post should work without problems, and
it would be good to investigate problem roots.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginix not servic static content as part of page

JohnSchulze February 05, 2010 06:08AM

Re: nginix not servic static content as part of page

Reinis Rozitis February 05, 2010 06:36AM

Re: nginix not servic static content as part of page

Maxim Dounin February 05, 2010 07:24AM

Re: nginix not servic static content as part of page

JohnSchulze February 05, 2010 03:04PM

Re: nginix not servic static content as part of page

Igor Sysoev February 05, 2010 04:10PM

Re: nginix not servic static content as part of page

JohnSchulze February 05, 2010 05:21PM

Re: nginix not servic static content as part of page

Igor Sysoev February 08, 2010 06:38AM

Re: nginix not servic static content as part of page

JohnSchulze February 05, 2010 03:26PM

Re: nginix not servic static content as part of page

JohnSchulze February 11, 2010 10:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 146
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready