RE: Отдача статики на хостинге

-=HaRius=- rh at nobrend.ru
Thu Aug 28 22:30:26 MSD 2008



-----Original Message-----
From: owner-nginx-ru at sysoev.ru [mailto:owner-nginx-ru at sysoev.ru] On Behalf Of Kirill A. Kalikin
Sent: Thursday, August 28, 2008 9:53 PM
To: nginx-ru at sysoev.ru
Subject: Отдача статики на хостинге

Здравствуйте.

Хочу отдавать статику nginx на своем маленьком хостинге.

Есть конфиг:
server {
                listen          192.168.88.7;
-                server_name     *.just.tomsk.ru;
+                server_name     www.smth.just.tomsk.ru smth.just.tomsk.ru;
                location / {
                        proxy_pass              http://httpd/;
                        proxy_redirect      off;
                        proxy_set_header        Host	$host;
                        }
                location ~* ^.+\.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
-                        root   /var/www/$host/htdocs/;
+                        root   /var/www/smth.just.tomsk.ru;
                        gzip on;
                        sendfile on;
                        }
}

Как сделать так чтобы по адресам:
http://smth.just.tomsk.ru/pic_path.jpg и 
http://www.smth.just.tomsk.ru/pic_path.jpg
отдавались из одна и таже картинка
/var/www/smth.just.tomsk.ru/pic_path.jpg

-- 
С уважением,
 Kirill                          mailto:kirill at tpu.ru




More information about the nginx-ru mailing list