if и set: <a href="http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#if">http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#if</a><br><br><div class="gmail_quote">20 января 2009 г. 23:26 пользователь Vladislav Vorobiev <span dir="ltr">&lt;<a href="http://mymir.org">mymir.org</a>@<a href="http://googlemail.com">googlemail.com</a>&gt;</span> написал:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Всем привет!<br>
<br>
У меня отсортированы картинки по именам доменов.<br>
По запросу img.domainname хотел бы их отдавать.<br>
<br>
<a href="http://img.d1" target="_blank">http://img.d1</a><br>
/home/static/d1<br>
<a href="http://img.d1" target="_blank">http://img.d1</a><br>
/home/static/d2<br>
<a href="http://img.d3" target="_blank">http://img.d3</a><br>
/home/static/d3<br>
<br>
итд...<br>
<br>
что то не могу догадаться как убрать из переменной $host «img.»<br>
<br>
то есть запрос &nbsp;<a href="http://img.domain.ru" target="_blank">img.domain.ru</a> пытается попасть в &nbsp;<a href="http://img.domain.ru" target="_blank">img.domain.ru</a> а надо<br>
в &nbsp;<a href="http://domain.ru" target="_blank">domain.ru</a><br>
<br>
2009/01/20 21:18:58 [error] 4592#0: *1 open()<br>
&quot;/home/static/<a href="http://img.domain.ru/search.gif" target="_blank">img.domain.ru/search.gif</a>&quot; failed (2: No such file or<br>
directory),<br>
<br>
конфиг такой<br>
<br>
server {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;listen &nbsp; &nbsp; &nbsp; 180;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;server_name &nbsp;img.*;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;location / {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; /home/static/$host;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #index &nbsp;index.html index.htm;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
}<br>
<br>
в Apache на данный момент все работает так<br>
<br>
&lt;VirtualHost *&gt;<br>
 &nbsp;ServerName <a href="http://images.com" target="_blank">images.com</a><br>
 &nbsp;ServerAlias *img*<br>
 &nbsp;RewriteEngine On<br>
 &nbsp;RewriteCond &nbsp; &nbsp;%{HTTP_HOST} &nbsp;^img\.(.*)<br>
 &nbsp;RewriteRule &nbsp; &nbsp;^(.*)$ &nbsp; &nbsp; &nbsp; &nbsp;/%1/$1 [L]<br>
 &nbsp;DocumentRoot /home/static/<br>
&lt;/VirtualHost&gt;<br>
<br>
пытаюсь перейти на nginx.<br>
Кто подскажет?<br>
<br>
Вообще как можно посмотреть все переменные nginx?<br>
</blockquote></div><br><br clear="all"><br>-- <br>С уважением, Борис Долгов.<br>icq 77556665<br>e-mail <a href="mailto:boris@dolgov.name">boris@dolgov.name</a><br>