ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Реврайт по имени сервер а


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: Реврайт по имени сервер а
  • From: Sergey Shepelev <temotor@xxxxxxxxx>
  • Date: Wed, 17 Mar 2010 10:27:07 +0300
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=RHQQ3n/BsKz2ue25GTTFWMZviUtKBAYtzCJUNA4/c2E=; b=Ql/NoqZg29VPhgizYN87CCV3Taxo44Ujg5FtCD+nsJ65zx11c+D63OGurI2g+3MYMX p/ZEHwoivlJnKUHMFbs1p+6c1ElpRNZoLUF3RQvnykvbFTZk7eby4NTG9N5//83X8n7b OwP4x4uB546Ug5DAvZhgPE6G6Uyg9a2B2Y6k8=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mD/SboJt19WR1hMz5KsUyCFOCVt8v4BavJuVf0yGaoF06EZlykBJK9nohp0fjIHts+ Tp0DS1Ej7NmI5exz47tZkETfY3sZmm1ej04PCE6HKPk6LGp5i4zGI8WojCifeS1IAlg2 cxUterVTWo/mi1Y2T+OuyzhjcuHNEDKMTqiZQ=
  • In-reply-to: <41a2751f0feb4aa36d8860e8b85fdff4.NginxMailingListRussian@xxxxxxxxxxxxxxx>
  • References: <41a2751f0feb4aa36d8860e8b85fdff4.NginxMailingListRussian@xxxxxxxxxxxxxxx>

2010/3/17 Johnatan Nevermind <nginx-forum@xxxxxxxx>:
> Как можно сделать  реврайт по имени сервера? Например, есть такой путь.
>
> /www/host_name/content/he/ll/o_/co/m/images/test.jpg
>
> поддиректория внутри content состоит из имени хоста(hello.com) разбитого по 2 
> символа. Так вот как нужно сконфигурировать nginx что бы было такое 
> перенаправление
>
> http://hello.com/images/test.jpg -> 
> http://hello.com/content/he/ll/o_/co/m/images/test.jpg
>
> Какие модули нужно использовать, как настраивать и т.д.

server {
  server_name hello.com;

  location / {
    rewrite ^ /content/he/ll/o_/co/m$request_uri? last;
  }

  location /content/he/ll/o_/co/m {
    root /www/host_name;
  }
}

>
> Posted at Nginx Forum: 
> http://forum.nginx.org/read.php?21,64625,64625#msg-64625
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@xxxxxxxxx
> http://nginx.org/mailman/listinfo/nginx-ru
>
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.