# Localhost path to images directory

**URL:** <https://www.ruby-forum.com/t/localhost-path-to-images-directory/214100>\
**Category:** NGINX\
**Created:** [November 21, 2011, 8:21pm UTC](https://www.ruby-forum.com/t/localhost-path-to-images-directory/214100 "2011-11-21T20:21:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 21, 2011, 8:21pm UTC](https://www.ruby-forum.com/t/localhost-path-to-images-directory/214100/1 "2011-11-21T20:21:52Z")

</div>

I have nginx and php5-fpm set up and working to serve /var/www/index.php  
as localhost/index.php  
That works fine. The images on the page are not showing up however. The  
images are in a folder /var/www/images  
The folder has same user/group permissions as the index page  
I can see an image in my file manager at /var/www/images/key.gif and  
gave it 777 permission  
Page source shows image should be at relative path images/key.gif  
Pageinfo (Firefox) says image should be at  
[http://localhost/images/key.gif](http://localhost/images/key.gif)  
Typing directly in browser window [http://localhost/images/key.gif](http://localhost/images/key.gif) gets a  
404

Posted at Nginx Forum:

> **[localhost path to images directory](https://forum.nginx.org/read.php?2,218718,218718#msg-218718)**
>
> I have nginx and php5-fpm set up and working to serve /var/www/index.php as localhost/index.php That works fine. The images on the page are not showing up however. The images are in a folder /var/www/images The folder has same user/group permissions...

---

<div class="post-metadata">

**Author:** ![bizshop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@bizshop](https://www.ruby-forum.com/u/bizshop)\
**Post date:** [November 21, 2011, 8:56pm UTC](https://www.ruby-forum.com/t/localhost-path-to-images-directory/214100/2 "2011-11-21T20:56:00Z")

</div>

On Mon, Nov 21, 2011 at 02:21:03PM -0500, bizshop wrote:

Hi there,

> That works fine. The images on the page are not showing up however. The  
> images are in a folder /var/www/images

> Typing directly in browser window [http://localhost/images/key.gif](http://localhost/images/key.gif) gets a  
> 404

The error log probably tells you what file nginx failed to find.

Do you have “root /var/www;” in the server{} block, outside of all  
location{}s?

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bizshop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@bizshop](https://www.ruby-forum.com/u/bizshop)\
**Post date:** [November 21, 2011, 9:11pm UTC](https://www.ruby-forum.com/t/localhost-path-to-images-directory/214100/3 "2011-11-21T21:11:26Z")

</div>

Thanks - that got me started in the right direction. Had to set images  
path in the default conf. Not something I had to do with apache as  
server, still learning this nginx!

Posted at Nginx Forum:

> **[Re: localhost path to images directory](https://forum.nginx.org/read.php?2,218718,218720#msg-218720)**
>
> I have nginx and php5-fpm set up and working to serve /var/www/index.php as localhost/index.php That works fine. The images on the page are not showing up however. The images are in a folder /var/www/images The folder has same user/group permissions...
