Welcome! Log In Create A New Profile

Advanced

Вопрос по тексту ошибки

Михаил Монашёв
January 17, 2013 09:22AM
Здравствуйте.

Имеется вот такой конфиг:

location ~* "^/(?<phost>[a-z0-9\-\.]+)/(?<puri>.*)" {
proxy_pass http://$phost:80/$puri;
proxy_set_header Host $1;
proxy_set_header Referer "http://$phost/";
proxy_set_header X-Real-IP "";
proxy_set_header Cookie "";
proxy_ignore_headers X-Accel-Redirect X-Accel-Expires X-Accel-Limit-Rate X-Accel-Buffering X-Accel-Charset Expires Cache-Control Set-Cookie;

proxy_hide_header Location;
proxy_hide_header Set-Cookie;
proxy_hide_header WWW-Authenticate;

proxy_intercept_errors on;
error_page 301 302 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 422 423 424 425 426 449 500 501 502 503 504 505 506 507 509 510 = @zero;

proxy_temp_path /optcache3/proxy-tmp;
proxy_cache_key "$phost/$puri";
proxy_cache optcache3;

image_filter test;
image_filter_buffer 10M;

}

location / {
return 403;
}

location @zero {
return 204;
}

А в логе вот такая ошибка:
2013/01/17 17:47:58 [error] 3963#0: *8162 kevent() reported that connect() failed (60: Operation timed out) while connecting to upstream, client: 80.239.243.119, server: i99.beon.ru, request: "GET /ishop.top-kniga.ru/data/m_ishc/1084/1084845.jpg HTTP/1.1", upstream: "http://91.206.106.43:80/data/m_ishc/1084/1084845.jpg", host: "i99.beon.ru", referrer: "http://tanitakokyto.beon.ru/24898-872-tema-dlja-raznyh-anket.zhtml"

По идее nginx должен был отрезолвить ishop.top-kniga.ru , соединится
с полученным ip и запросить http://ishop.top-kniga.ru/data/m_ishc/1084/1084845.jpg

Текст ошибки меня удивил. Его я его понял так: не удалось соединиться
с ip, в который отрезолвился ishop.top-kniga.ru. Но при это
показываются странные данные про апстрим:
upstream: "http://91.206.106.43:80/data/m_ishc/1084/1084845.jpg"
Хотя мне видится, что он должен быть таким:
http://ishop.top-kniga.ru/data/m_ishc/1084/1084845.jpg , ведь в
конфиге написано:
proxy_pass http://$phost:80/$puri;
, где $phost - это домен, а не ip.

Как получилось http://91.206.106.43:80/data/m_ishc/1084/1084845.jpg
понятно. Вопрос в том, правильно ли это?


nginx version: nginx/1.3.11
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-debug --with-file-aio
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_image_filter_module
--with-http_stub_status_module --with-pcre

--
С уважением,
Михаил mailto:postmaster@softsearch.ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Вопрос по тексту ошибки

Михаил Монашёв January 17, 2013 09:22AM

Re: Вопрос по тексту ошибки

Михаил Панфилов January 17, 2013 09:34AM

Re[2]: Вопрос по тексту ошибки

Михаил Монашёв January 17, 2013 09:38AM

Re: Re[2]: Вопрос по тексту ошибки

Михаил Панфилов January 17, 2013 09:42AM

Re: Вопрос по тексту ошибки

Gena Makhomed January 17, 2013 11:48AM

Re[2]: Вопрос по тексту ошибки

Михаил Монашёв January 17, 2013 12:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready