<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=KOI8-R" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi John, <br>
<br>
Is the problem that Nginx is URL-encoding the whole string, including
&'s, so that you'd have to name your directories with %20 or %26
(for &) in the directory names?š I believe both (space) and %20
will go to %20 , the same for &, though I may be wrong.<br>
<br>
I think you'd need to name your directory Client%20Files for it to
work, and if you have an ampersand, you'd need to use %26.<br>
<br>
I've had this problem before when proxying from Nginx to PBMS - it
wouldn't work because the & was URL-encoded and PBMS can (or could
at that time) only use non-url-encoded &'s.<br>
<br>
On Apache and Litespeed (which uses Apache's rewrite rules) there's a
re-write option to add to prevent URL-encoding ([NE]), but I don't
believe there is for Nginx (or at least I didn't know about one when I
was looking at it).<br>
<br>
That option may have been added since,š or if not, it might be
something useful to add. Something like:<br>
<br>
rewrite ... nourlencode;<br>
<br>
Cheers,<br>
<br>
Marcus.<br>
<br>
<br>
Igor Sysoev wrote:
<blockquote cite="mid:20090505062420.GI21621@rambler-co.ru" type="cite">
<pre wrap="">On Tue, May 05, 2009 at 07:53:22AM +0200, John Stykes wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi Igor, thanks for the response.
I have that setting already. The problem is that when the request comes
with a space (%20) or an ampersand (&) it causes problems and nginx
cannot find that directory. So when a request comes for file1.doc in the
directory 'Client Files' it cannot find that directory even if i named
it Client\ Files on the filesystem.
This is why i thought perhaps i could rewrite the url or the directory
portion so that if a request comes for Client%20Files i simply use a
different directory called clientfiles with no spaces.
</pre>
</blockquote>
<pre wrap=""><!---->
Could you show the error_log message about these files ?
nginx uses decoded names.
</pre>
<blockquote type="cite">
<pre wrap="">thanks
John
I have tried using a directory such as
Igor Sysoev wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Tue, May 05, 2009 at 05:59:14AM +0200, John Stykes wrote:
</pre>
<blockquote type="cite">
<pre wrap="">the problem however occurs when 2 specific requests come to the server
but the 2 specific urls above are problematic because of the spaces (in
both) and the ampersand (in one).
i've tried endless rewrite rules to make the 2 examples above point to a
different directory on the filesystem but nginx cannot find the file and
i get 404 errors. Filesystem is linux.
I have tried using a directory with spaces escaped with \ - no luck
</pre>
</blockquote>
<pre wrap="">If these files are served by nginx without backend participation,
the you need just
location /clientfiles {
root /var/www/data;
}
</pre>
</blockquote>
<pre wrap="">--
Posted via <a class="moz-txt-link-freetext" href="http://www.ruby-forum.com/">http://www.ruby-forum.com/</a>.
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>