nginx virtualhosts

Igor Sysoev is at rambler-co.ru
Tue Jan 8 20:40:21 MSK 2008


On Tue, Jan 08, 2008 at 05:55:50PM +0100, Stefanita rares Dumitrescu wrote:

> Igor Sysoev wrote:
> > On Tue, Jan 08, 2008 at 05:12:16PM +0100, Stefanita rares Dumitrescu 
> > wrote:
> > 
> >>     server_names_hash_bucket_size  128;
> >>     server {
> >>         listen       xx.xx.xx.xx:80;
> >>         server_name  host1.com;
> >>         #charset koi8-r;
> >>         access_log  logs/host1.com.access.log main;
> >>         location /data {
> >>             root /home/fs01/storage;
> >>             internal;
> >>             }
> > 
> > Here you have two different "location /":
> 
> 
> you mean :
> 
> >>         location /data {
> >>             root /home/fs01/storage;
> 
> this one?

No I meant

        location / {
            root   /home/fs01/www;
            index  index.html index.htm index.php;
        }

        location / {


Please read http://wiki.codemongers.com/NginxHttpCoreModule#location

> btw. i have another question.
> 
> the static config. the syntax is correct? i mean having 2 locations 
> defined with static content. i defined 1 for each virtualhost. is it 
> possible to make it global?
> 
> i tried defining
>    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|zip)$ {
>             root              /;
> 
> instead of
> 
>         # serve static files directly
>         location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|zip)$ {
>             root              /home/fs01/storage;
>             access_log        off;
>             expires           30d;
>         }
> 
>         # serve static files directly
>         location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|zip)$ {
>             root              /home/m1emuz/public_html;
>             access_log        off;
>             expires           30d;
>         }
> 
> but seems it's not working.

No, please read
http://wiki.codemongers.com/NginxHttpCoreModule#location
http://wiki.codemongers.com/NginxHttpCoreModule#root


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





More information about the nginx mailing list