Welcome! Log In Create A New Profile

Advanced

Problems with rewrite on windows

September 10, 2009 08:12AM
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
Subject Author Posted

Problems with rewrite on windows

halfd September 10, 2009 08:12AM

Re: Problems with rewrite on windows

halfd September 10, 2009 08:27AM

Re: Problems with rewrite on windows

Igor Sysoev September 10, 2009 08:32AM

Re: Problems with rewrite on windows

halfd September 10, 2009 08:59AM

Re: Problems with rewrite on windows

Igor Sysoev September 10, 2009 09:20AM

Re: Problems with rewrite on windows

halfd September 10, 2009 09:57AM

Re: Problems with rewrite on windows

Igor Sysoev September 10, 2009 10:12AM

Re: Problems with rewrite on windows

halfd September 10, 2009 10:26AM

Re: Problems with rewrite on windows

Igor Sysoev September 10, 2009 11:08AM

Re: Problems with rewrite on windows

halfd September 15, 2009 10:10AM

Re: Problems with rewrite on windows

Igor Sysoev September 16, 2009 09:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready