# Document root problem?

**URL:** <https://www.ruby-forum.com/t/document-root-problem/185075>\
**Category:** NGINX\
**Created:** [March 13, 2010, 12:18am UTC](https://www.ruby-forum.com/t/document-root-problem/185075 "2010-03-13T00:18:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flash](https://www.ruby-forum.com/u/flash)\
**Post date:** [March 13, 2010, 12:18am UTC](https://www.ruby-forum.com/t/document-root-problem/185075/1 "2010-03-13T00:18:33Z")

</div>

I am running a wordpress setup with nginx and I have an error that I  
haven’t been able to track down. In my log files I’m getting a lot of  
errors like this:

" 17434#0: \*140 open() “/home/tcb/public\_htmlon” failed (2: No such file  
or directory) … "

This is causing a lot of my pages to not load. My document root is  
/home/tcb/public\_html without the “on” This error is not isolated to any  
particular file or script (i.e. getting it for phpmyadmin, wordpress  
pages, etc) but it is not consistent.

For example - here is a rewrite rule I have in place: (using the  
wordpress plugin and rewrites)

location / {  
rewrite log on; //side question - where does this write too?  
rewrite ^/([0-9]+)/([\_0-9a-zA-Z-]+)/?$ $theme/listing.php?mls=$1  
last;  
rewrite ^/([0-9]+)/([\_0-9a-zA-Z-]+)+.html?$  
$theme/listing.php?mls=$1 last;  
rewrite ^/([0-9]+)/?$ $theme/listing.php?mls=$1 last;  
try\_files $uri $uri/ @wordpress;  
}

This address works -  
[http://sellsutah.net/938326/210-summit-dr-smithfield-utah/](http://sellsutah.net/938326/210-summit-dr-smithfield-utah/)  
and this one fails -  
[http://sellsutah.net/784004/1290-e-1550-n-north-logan-utah/](http://sellsutah.net/784004/1290-e-1550-n-north-logan-utah/)  
with a 404 file not found error

The second one puts an entry in the error log with the error I gave  
above.

I very happy with the speed increase from nginx - but frustrated by this  
issue

Thank you

Flash

Posted at Nginx Forum:

> **[document root problem?](https://forum.nginx.org/read.php?2,63269,63269#msg-63269)**
>
> I am running a wordpress setup with nginx and I have an error that I haven't been able to track down. In my log files I'm getting a lot of errors like this: "\[error\] 17434#0: \*140 open() "/home/tcb/public\_htmlon" failed (2: No such...

---

<div class="post-metadata">

**Author:** ![flash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flash](https://www.ruby-forum.com/u/flash)\
**Post date:** [March 13, 2010, 12:40am UTC](https://www.ruby-forum.com/t/document-root-problem/185075/2 "2010-03-13T00:40:12Z")

</div>

Hello!

On Fri, Mar 12, 2010 at 06:17:58PM -0500, flash wrote:

> phpmyadmin, wordpress pages, etc) but it is not consistent.
> 
> For example - here is a rewrite rule I have in place: (using the  
> wordpress plugin and rewrites)
> 
> location / {  
> rewrite log on; //side question - where does this write too?

This rewrites any uri containing ‘log’ into ‘on’ (which isn’t  
really valid uri). And this causes the message you have.

If you want rewrite logging you should switch it on via

```
   rewrite_log on;

```

Note ‘\_’. Rewrites will be logged to error\_log at notice level.

[…]

Maxim D.

---

<div class="post-metadata">

**Author:** ![flash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flash](https://www.ruby-forum.com/u/flash)\
**Post date:** [March 13, 2010, 12:42am UTC](https://www.ruby-forum.com/t/document-root-problem/185075/3 "2010-03-13T00:42:32Z")

</div>

On Fri, Mar 12, 2010 at 06:17:58PM -0500, flash wrote:

> In my log files I’m getting a lot of errors like this:
> 
> " 17434#0: \*140 open() “/home/tcb/public\_htmlon” failed (2: No such file or directory) … "
> 
> ```
> rewrite log on; //side question - where does this write too?
> 
> ```

```
           ^^^

```

> and this one fails - [NameBright - Domain Expired](http://sellsutah.net/784004/1290-e-1550-n-north-logan-utah/)

```
                                                                   ^^^

```

I’m not sure what you think the “rewrite log on” line does, but I think  
you  
probably want to remove it.

---

<div class="post-metadata">

**Author:** ![flash](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@flash](https://www.ruby-forum.com/u/flash)\
**Post date:** [March 13, 2010, 1:45am UTC](https://www.ruby-forum.com/t/document-root-problem/185075/4 "2010-03-13T01:45:12Z")

</div>

It’s funny how these things work, I spent the better part of two days  
trying to figure this one out - for the life of me I couldn’t find  
anything that would put “on” at the end of my doc root - of course it  
was staring me right in the face - just needed to look up one line - to  
see it. The second url that I gave has “logan” in the address line -  
which get’s rewritten to “on” - nice.

Thanks for the help guys - and to think I almost omitted that line when  
I made my post.

Flash

Posted at Nginx Forum:

> **[Re: document root problem?](https://forum.nginx.org/read.php?2,63269,63286#msg-63286)**
>
> I am running a wordpress setup with nginx and I have an error that I haven't been able to track down. In my log files I'm getting a lot of errors like this: "\[error\] 17434#0: \*140 open() "/home/tcb/public\_htmlon" failed (2: No such...
