# Why does nginx work at the server IP address only with default root location?

**URL:** <https://www.ruby-forum.com/t/why-does-nginx-work-at-the-server-ip-address-only-with-default-root-location/228417>\
**Category:** NGINX\
**Created:** [April 21, 2013, 9:51pm UTC](https://www.ruby-forum.com/t/why-does-nginx-work-at-the-server-ip-address-only-with-default-root-location/228417 "2013-04-21T21:51:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_NSPace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Paul\_NSPace](https://www.ruby-forum.com/u/Paul_NSPace)\
**Post date:** [April 21, 2013, 9:51pm UTC](https://www.ruby-forum.com/t/why-does-nginx-work-at-the-server-ip-address-only-with-default-root-location/228417/1 "2013-04-21T21:51:48Z")

</div>

I have set up a server on Rackspace using Ubuntu 12.04 and the nginx  
stable PPA.

Using the default root location of /usr/share/nginx/html the  
index.html file is displayed when I call the public IP address of the  
server.

If I change the root location to my own /var/www/example.com/public  
the index.html file is not displayed.

Output of ll on /var/www/example.com/public:

drwxrwsr-x 2 www-data www-data 4096 Apr 21 04:13 ./  
drwxrwsr-x 7 www-data www-data 4096 Apr 21 03:55 …/  
-rw-rw-r-- 1 www-data www-data 624 Apr 21 04:17 index.html

This is the only change I make and I get the failure, but I don’t  
expect it. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Paul\_NSPace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Paul\_NSPace](https://www.ruby-forum.com/u/Paul_NSPace)\
**Post date:** [April 21, 2013, 10:09pm UTC](https://www.ruby-forum.com/t/why-does-nginx-work-at-the-server-ip-address-only-with-default-root-location/228417/2 "2013-04-21T22:09:54Z")

</div>

At a guess, /var or /var/www isn’t readable by www-data

Steve

---

<div class="post-metadata">

**Author:** ![Paul\_NSPace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Paul\_NSPace](https://www.ruby-forum.com/u/Paul_NSPace)\
**Post date:** [April 21, 2013, 10:15pm UTC](https://www.ruby-forum.com/t/why-does-nginx-work-at-the-server-ip-address-only-with-default-root-location/228417/3 "2013-04-21T22:15:10Z")

</div>

Steve, you are a Linux genius, and I am but a humble plebe, forever in  
your debt.
