Re: Неправильный порт в редиректах

Igor Sysoev igor на sysoev.ru
Чт Апр 29 08:42:23 MSD 2010


On Wed, Apr 28, 2010 at 04:33:43PM -0400, wmiadmin wrote:

> Debian Lenny
> nginx version: nginx/0.7.65 - из исходников.
> 
> [code]
> http://domain.com/admin
> 
> GET /admin HTTP/1.1
> Host: domain.com
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language: ru
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 115
> Connection: keep-alive
> 
> HTTP/1.1 301 Moved Permanently
> Server: nginx
> Date: Thu, 29 Apr 2010 04:22:52 GMT
> Content-Type: text/html; charset=iso-8859-1
> Connection: keep-alive
> Location: http://domain.com:8080/admin/
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Content-Length: 256
> [/code]
> 
> [code]
> 192.168.1.2 - - [28/Apr/2010:16:03:26 -0400] "GET /admin HTTP/1.1" 301 304 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)"
> [/code]
> 
> [code]
> location / {
>                 index index.php;
>                 proxy_pass         http://127.0.0.1:8080/;
>                 proxy_redirect     off;
>                 proxy_set_header   Host             $host;
>                 proxy_set_header   X-Real-IP        $remote_addr;
>                 proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
>                 client_max_body_size       500m;
>                 client_body_buffer_size    128k;
>                 proxy_connect_timeout      90;
>                 proxy_send_timeout         900;
>                 proxy_read_timeout         900;
>                 proxy_buffer_size          4k;
>                 proxy_buffers              4 32k;
>                 proxy_busy_buffers_size    64k;
>                 proxy_temp_file_write_size 64k;
>                 charset         off;
>                 track_uploads proxied 30s;
>             }
> [/code]
> 
> proxy_redirect     off или on ситуацию не меняет.
> 
> [url=http://forum.nginx.org/read.php?11,59798,59830#msg-59830]Help redirect :([/url]
> [url=http://www.ruby-forum.com/topic/148567]nginx redirecting to wrong port[/url]
> вроде у всех всё заработало - чего-то у меня не так.
> Apache конфигурация может влиять ?

              proxy_pass         http://127.0.0.1:8080/;
              proxy_redirect     http://domain.com:8080/  /;


-- 
Игорь Сысоев
http://sysoev.ru



Подробная информация о списке рассылки nginx-ru