nginx virtualhosts

Stefanita rares Dumitrescu lists at ruby-forum.com
Tue Jan 8 19:55:50 MSK 2008


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?

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.
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list