nginx can't read images

Aditya Herlambang aditya15417 at
Sun Feb 27 18:35:26 MSK 2011

Is it also possible to change my php directive to:
 location ~ \.php$ {            root           html;            fastcgi_pass;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  html$fastcgi_script_name;           include        fastcgi_params;        }
?? Will it do the same?

> Date: Sun, 27 Feb 2011 12:50:35 +0000
> From: francis at
> To: nginx at
> Subject: Re: nginx can't read images
> On Sun, Feb 27, 2011 at 04:47:00AM +0000, Aditya Herlambang wrote:
> Hi there,
> > So it seems that mginx can't read a url with .png, for example
> nginx usually does exactly what you tell it to. In this case...
> >
> > that gives me a page not found. The ip address above has been changed (not the original one), it'sjust to give illustration. I checked that the file logo_right.png is in fact in that folder. What do I need to do to solve this?
> ...what folder is the file logo_right.png in?
> Your config tells nginx to look for
> /usr/local/nginx/html/phpMyAdmin/themes/original/img/logo_right.png
> but your config also suggests that you wanted to tell nginx to look for
> /usr/share/nginx/html/phpMyAdmin/themes/original/img/logo_right.png
> Each (sub)request in nginx in handled by one location{} block, so you
> must make sure that the correct config is in the location block that is
> used for this specific request. Your location{} for .png urls uses the
> compile-time document root value.
> If this server is new, and not used for other files or services, then
> the best change is probably to remove all "root" directives from your
> nginx.conf, and add a single "root /usr/share/nginx/html;" outside all
> location{}s, just after "server_name  localhost;"
> Otherwise, you should probably add a "location /phpMyAdmin/ {}" which
> contains other location{}s for the new urls you care about.
> Note also that the distributed phpMyAdmin includes a few .htaccess files
> to attempt to limit access to some files. There's nothing in your config
> to mimic that, so unless you've taken other steps, you may be exposing
> more that the phpMyAdmin developers consider wise.
> Good luck with it,
> 	f
> -- 
> Francis Daly        francis at
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list