Need to serve multiple directories/drives on windows

Igor Sysoev is at rambler-co.ru
Tue Jun 16 22:10:03 MSD 2009


On Tue, Jun 16, 2009 at 11:01:00AM -0700, dwatrous wrote:

> Thanks for the reply.  This still isn't working.  Here is my entire
> config file.  As an initial test I've included only the C drive.
> 
> worker_processes  1;
> 
> events {
>     worker_connections  1024;
> }
> 
> http {
>     include       mime.types;
>     default_type  application/octet-stream;
>     sendfile        on;
>     keepalive_timeout  65;
>     server {
>         listen       50000;
>         server_name  localhost;
> 
> 	location /c {
> 	    root  c:/;
> 	}
> 
>         location / {
>             root   html;
>             index  index.html index.htm;
>         }
> 
>         error_page   500 502 503 504  /50x.html;
>         location = /50x.html {
>             root   html;
>         }
> 
>     }
> 
> }
> 
> I've tried it with just C:/, with both C:/ and / as shown here and with
> all drives.  The / location will always load, but the others won't.
> Here's what I get
> http://localhost:50000/ produces "Welcome to nginx!" with the log file
> showing:
> 127.0.0.1 - - [16/Jun/2009:11:58:05 -0600] "GET / HTTP/1.1" 304 0 "-"
> "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5
> (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5"
> 127.0.0.1 - - [16/Jun/2009:11:58:05 -0600] "GET /favicon.ico HTTP/1.1"
> 404 169 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5"
> 
> http://localhost:50000/c and http://localhost:50000/c/ and
> http://localhost:50000/c/index.html (so in other words attempting to
> download a file I know is there) produce 404 errors and the following
> log messages:
> 127.0.0.1 - - [16/Jun/2009:11:59:00 -0600] "GET /c HTTP/1.1" 404 169 "-"
> "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5
> (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5"
> 127.0.0.1 - - [16/Jun/2009:11:59:07 -0600] "GET /c/ HTTP/1.1" 404 169
> "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5
> (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5"
> 127.0.0.1 - - [16/Jun/2009:11:59:18 -0600] "GET /c/index.html HTTP/1.1"
> 404 169 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
> AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5"
> 
> I've tried the same thing in Firefox in addition to Chrome and observed
> basically the same output of 404 errors.
> 
> What am I missing?

What is in error_log ?

> Thanks.
> 
> -----Original Message-----
> From: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] On Behalf Of
> Igor Sysoev
> Sent: Tuesday, June 16, 2009 10:32 AM
> To: nginx at sysoev.ru
> Subject: Re: Need to serve multiple directories/drives on windows
> 
> On Tue, Jun 16, 2009 at 09:13:54AM -0700, dwatrous wrote:
> 
> > Hello,
> > 
> > I'm interested in moving from Apache to nginx.  What I'm doing with
> > Apache right now is serve files from multiple drives on windows.  For
> > each drive I have a Directory entry in the httpd.conf and also an
> Alias
> > entry.
> > <Directory "e:/">
> >     Options Indexes FollowSymLinks
> >     AllowOverride None
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > 
> > <Directory "k:/">
> >     Options Indexes FollowSymLinks
> >     AllowOverride None
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > 
> >     Alias /c c:/
> >     Alias /e e:/
> >     Alias /k k:/
> > 
> > I've tried setting the root in the nginx config file to "C:\" (without
> > the quotes), but then nginx won't start.  I will need to serve files
> > from drives C:, E: and K: at the same time for one server box.
> > 
> > Please let me know if there is a way to define multiple locations like
> > this.
> 
> location /c {
>     root  c:/;
> }
> 
> location /e {
>     root  e:/;
> }
> 
> location /k {
>     root  k:/;
> }
> 
> 
> -- 
> Igor Sysoev
> http://sysoev.ru/en/
> 

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list