| Nginx-ru mailing list archive (nginx-ru@sysoev.ru) [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
 Re: location + rewrite
 
 On Wed, Mar 23, 2011 at 07:24:20AM -0400, Melhior wrote:
> server {
>                 listen       123.123.123.123:80;
>                 server_name  www.example1.com example1.com;
> 
> location  / {
>          proxy_pass         http://127.0.0.1:80/;
> }
> 
> location ~* \.(gif|jpg|bmp|png)$ {
>         rewrite ^/(.*)$  http://files.example1.com/$1 permanent; break;
> }
> 
> 
> 
> server {
>                 listen       123.123.123.123:80;
>                 server_name  www.example2.com example2.com;
> 
> location  / {
>          proxy_pass         http://127.0.0.1:80/;
> }
> 
> location ~* \.(gif|jpg|bmp|png)$ {
>         rewrite ^/(.*)$  http://files.example2.com/$1 permanent; break;
> }
"break" не нужен.
> При попытке сделать запрос
> http://www.example1.com/abcd.gif   меня правильно
> перекидывает на http://files.example1.com/abcd.gif 
> 
> При попытке сделать запрос
> http://www.example2.com/abcd.gif  меня снова
> перекидывает на http://www.example1.com/abcd.gif 
> 
> В чем ошибка?
Что показывает "nginx -c" ?
-- 
Игорь Сысоев
http://sysoev.ru
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
 |