Jim Ohlstein Wrote:
-------------------------------------------------------
> Don't worry about your English. I understand you
> fine. :) Twój angielski jest dużo lepiej niż
> moj polski!
>
> You can create whatever document root you want
> like this:
>
>
> server {
> listen 80;
> server_name myserver.pl www.myserver.pl;
> index index.html;
> root /home/myserver.pl;
> ...
> }
>
>
>
> or, if you want to keep the default, only move
> some subdirectories:
>
>
> server {
> ...
> location /foo/ {
> root /home/path/to/foo;
> ...
> }
> ...
> }
>
>
>
> Now a request for
> http://myserver.pl/foo/images/123.jpg will return
> /home/path/to/foo/images/123.jpg.
>
>
> Using the default in the nginx.conf is fine if
> there is only one virtual host on the server.
> Otherwise you need to separate out into separate
> server blocks like above.
>
> Another option is to create a directory called
> "sites-enabled" and put a file for each virtual
> host in it. Then you can add a line at the end of
> nginx.conf:
>
>
> include /path/to/sites-enabled/*;
>
I am sorry! I see your answer and I do it ,but I don't see anything.
this is my config file bellow:
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
[color=#FF0000]location /foo {
root html/foo;
index index.html index.htm;[/color]
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
the red type is added the config file. I copy the file "index.html" to the directory "foo".default document is "/usr/local/webserver/nginx/html".
make a directory "foo" in html.
Edited 1 time(s). Last edit at 06/30/2009 11:49PM by jason_wang.