ПРОЕКТЫ 


  АРХИВ 


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]

upstream keepalive + Host override : problem?


  • To: "nginx-ru@xxxxxxxxx" <nginx-ru@xxxxxxxxx>
  • Subject: upstream keepalive + Host override : problem?
  • From: Azarov Alexander <self@xxxxxxx>
  • Date: Mon, 29 Apr 2013 14:53:19 +0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alaz.me; s=human; h=x-received:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version:x-mailer; bh=Pl4fubE2l36k1cQ2vogF4D/hwR7Ilmlf5I8nnPdKfRo=; b=emr6Wn5REYNiWEzvYws0oMHZSd/DnpfN/HiX/hbhWQ6L2alTXTiRMJiJDq7CLYRj9G LeVxiqrnLTw+OzvqtbXdobGn99zoXlief3y+W/O3C2tPQFdIJ+vxQcrhaa7r7gcfq3Gz iD3a/jezE1UD4vOdJ0noiKVInAeYTmwN8xnrQ=

Добрый день,

Конфиг у меня выглядит вот так:

upstream playapp {
  server ?:9000;
  keepalive 16;
}

server {
  listen ... ssl;
  server_name ?;

  proxy_set_header Host $server_name;

  location / {
    limit_conn byConn 14;
    limit_req zone=byReq burst=50;

    proxy_pass http://playapp;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
  }
}

Проблема:

2013/04/29 14:19:02 [debug] 21900#0: *1013606439 http proxy header:
"GET /pic/2034583 HTTP/1.1
Host: playapp
Cache-Control: max-age=0
Pragma: no-cache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 
(KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31

Т.е. на бэкенд уходит "Host: playapp" вместо "Host: $server_name". Если убрать 
proxy_http_version и proxy_set_header Connection, все нормализуется, бэкенд 
видит "Host: $server_name"

# nginx -V
nginx version: nginx/1.2.6
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx 
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log 
--http-client-body-temp-path=/var/cache/nginx/body 
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi 
--http-log-path=/var/log/nginx/access.log 
--http-proxy-temp-path=/var/cache/nginx/proxy 
--http-scgi-temp-path=/var/cache/nginx/scgi 
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi --lock-path=/var/lock/nginx.lock 
--pid-path=/run/nginx.pid --with-pcre-jit --with-debug 
--with-http_addition_module --with-http_dav_module --with-http_flv_module 
--with-http_geoip_module --with-http_gzip_static_module 
--with-http_image_filter_module --with-http_mp4_module --with-http_perl_module 
--with-http_random_index_module --with-http_realip_module 
--with-http_secure_link_module --with-http_stub_status_module 
--with-http_ssl_module --with-http_sub_module --with-ipv6 
--with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl 
--without-mail_pop3_module --without-mail_imap_module 
--without-mail_smtp_module 
--add-module=/usr/src/nginx-1.2.6/debian/modules/nginx-echo 
--add-module=/usr/src/nginx-1.2.6/debian/modules/nginx-upstream-fair 
--add-module=/usr/src/nginx-1.2.6/debian/modules/nginx-cache-purge

С уважением,
Александр
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.