Hello everyone!
I am experiencing a rather unsuspected problem with rewrites in nginx on a Windows 2003 server.
I have a system running behind nginx, which generates HTML files and places them
in folders.
In my config I have following:
[code]
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
[/code]
As you all know, this is to produce clean urls, and this works well in almost all situations.
Except when one enters an address using non-ascii characters (the site is danish, so they are frequent.)
When I enter the url (ex) /mere/æv/ I get a 404
The corrosponding line in error.log is
[code]
2009/09/10 13:50:22 [error] 4020#3292: *2 "c:/webroot/WEBSITE/site/www/mere/æv/index.html" is not found (3: The system cannot find the path specified), client: MYIPADDR, server: WEBSITE, request: "GET /mere/%C3%A6v/ HTTP/1.1", host: "WEBSITE"
[/code]
And this is in access log :
[code]
MYIPADDR - - [10/Sep/2009:13:50:22 +0200] "GET /mere/%C3%A6v/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
[/code]
First of all, the path and filename is correct.
The really weird thing is that when I put the index.html after the URL in the browser (ie) /mere/æv/index.html it works fine!
See this line in access log :
[code]
MYIPADDR - - [10/Sep/2009:13:51:15 +0200] "GET /mere/%C3%A6v/index.html HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
[/code]
Here is a request for a straight URL with only ASCII, works fine.
[code]
MYIPADDR - - [10/Sep/2009:13:53:50 +0200] "GET /mere/ HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
[/code]
This setup works fine on a linux box and os x, but is giving me headaches on windows :(
Additional info :
The folder in the example is named "æv", not "%C3%A6v" or the like. This works on the other boxes and when appending index.html to the url.
Any help would be greatly appreciated, many thanks in advance
Halfdan Mouritzen