# Nginx problem - failed (20: Not a directory)

**URL:** <https://www.ruby-forum.com/t/nginx-problem-failed-20-not-a-directory/191481>\
**Category:** NGINX\
**Created:** [July 13, 2010, 11:28am UTC](https://www.ruby-forum.com/t/nginx-problem-failed-20-not-a-directory/191481 "2010-07-13T11:28:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [July 13, 2010, 11:28am UTC](https://www.ruby-forum.com/t/nginx-problem-failed-20-not-a-directory/191481/1 "2010-07-13T11:28:40Z")

</div>

I have some rewrites for the SMF forum and they work just fine.  
The problem I’m having is that they are filling up my error log with  
“failed (20: Not a directory)” messages for some reason.

My rewrites are :

location /forum/ {  
root /usr/www-data/domain.com/httpdocs;  
if (!-e $request\_filename) {  
rewrite  
^/index.php/([a-z]+),([0-9]+).(\w+)/(\w+),(\w+)/(\w+).html  
/index.php?$1=$2.$3&$4=$5&$6 last;  
rewrite ^/index.php/([a-z]+),([0-9]+).(\w+)/(\w+),(\w+).html  
/index.php?$1=$2.$3&$4=$5 last;  
rewrite ^/index.php/([a-z]+),([0-9]+).(\w+)/(\w+)/(\w+).html  
/index.php?$1=$2.$3&$4&$5 last;  
rewrite ^/index.php/([a-z]+),([0-9]+).(\w+)/(\w+).html  
/index.php?$1=$2.$3&$4 last;  
rewrite ^/index.php/([a-z]+),([0-9]+).(\w+).html  
/index.php?$1=$2.$3 last;  
}  
}

The exact error message is :

[error] 75594#0: \*1 open()  
“/usr/www-data/domain.com/httpdocs/forum/index.php/topic,27483.msg586060/topicseen.html”  
failed (20: Not a directory), client: XXX.XXX.XXX.XXX, server:  
[domain.com](http://domain.com), request: “GET  
/forum/index.php/topic,27483.msg586060/topicseen.html HTTP/1.1”, host:  
“[www.domain.com:8080](http://www.domain.com:8080)”

Could someone please help me with this?

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [July 13, 2010, 7:17pm UTC](https://www.ruby-forum.com/t/nginx-problem-failed-20-not-a-directory/191481/2 "2010-07-13T19:17:11Z")

</div>

Hello!

On Sat, Jul 03, 2010 at 09:46:11PM -0700, Ken wrote:

> ```
> rewrite ^/index\.php/([a-z]+),([0-9]+)\.(\w+)/(\w+)/(\w+)\.html /index.php?$1=$2.$3&$4&$5 last; 
> rewrite ^/index\.php/([a-z]+),([0-9]+)\.(\w+)/(\w+)\.html /index.php?$1=$2.$3&$4 last; 
> rewrite ^/index\.php/([a-z]+),([0-9]+)\.(\w+)\.html /index.php?$1=$2.$3 last; 
> } 
> } 
> 
> ```

Your rewrites doesn’t match anything as they are in “/forum/”  
location (and hence only have chance to see requests starting from  
“/forum/”) but anchored to “^/index”.

> The exact error message is :
> 
> [error] 75594#0: \*1 open() “/usr/www-data/domain.com/httpdocs/forum/index.php/topic,27483.msg586060/topicseen.html” failed (20: Not a directory), client: XXX.XXX.XXX.XXX, server: [domain.com](http://domain.com), request: “GET /forum/index.php/topic,27483.msg586060/topicseen.html HTTP/1.1”, host: “www.domain.com:8080”
> 
> Could someone please help me with this?

This is expected error message: you are trying to access something  
below index.php, but index.php isn’t a directory.

Maxim D.

---

<div class="post-metadata">

**Author:** ![ken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@ken](https://www.ruby-forum.com/u/ken)\
**Post date:** [July 14, 2010, 3:15am UTC](https://www.ruby-forum.com/t/nginx-problem-failed-20-not-a-directory/191481/3 "2010-07-14T03:15:28Z")

</div>

On Wed, Jul 14, 2010 at 1:16 AM, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> This is expected error message: you are trying to access something  
> below index.php, but index.php isn’t a directory.

So, where’s PATHINFO ?

–  
Ren Xiaolei
