<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>fastcgi на удалённом сервере.</title>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
margin: 5px 5px 5px 5px;
background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
span.rvts1 /* Heading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #0000ff;
}
span.rvts2 /* Subheading */
{
font-size: 10pt;
font-family: 'Arial';
font-weight: bold;
color: #000080;
}
span.rvts3 /* Keywords */
{
font-size: 10pt;
font-family: 'Arial';
font-style: italic;
color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
font-size: 10pt;
font-family: 'Arial';
color: #008000;
text-decoration: underline;
}
span.rvts6
{
font-size: 8pt;
font-family: 'arial';
font-style: italic;
color: #c0c0c0;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
text-align: left;
text-indent: 0px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
text-align: center;
}
--></style>
</head>
<body>
<p>Hello Igor,</p>
<p><br></p>
<p> Потратил пол-дня на чтение архива, курения гугла, и личных экспериментов с nginx.</p>
<p>Видимо человеческая несообразительность не имеет границ :(</p>
<p><br></p>
<p><br></p>
<p>Встала необходимость распределить нагрузку на несколько backend fastcgi серверов. </p>
<p><br></p>
<p>FrontEnd на nginx. </p>
<p>адрес сервера 1.1.1.1</p>
<p>кусок конфига.</p>
<p><br></p>
<p>location /search.php {</p>
<p>...</p>
<p>fastcgi_pass 1.1.1.2:5555 ;</p>
<p>fastcgi_param DOCUMENT_ROOT /data/www/htdocs/mysite ;</p>
<p>fastcgi_param SCRIPT_NAME /data/www/htdocs/mysite$fastcgi_script_name ;</p>
<p>fastcgi_param PATH_TRANSLATED /data/www/htdocs/mysite ;</p>
<p><br></p>
<p><br></p>
<p>}</p>
<p><br></p>
<p>На другом сервере, с адресом 1.1.1.2 на порту 5555 поднято десяток php-fcgi .</p>
<p><br></p>
<p>При обращении на /search.php получаю 502 Bad Gateway</p>
<p><br></p>
<p>В дебаг логе вижу </p>
<p><br></p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 connect to 1.1.1.2:55555, fd:8 #39</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream connect: -2</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 event timer add: 8: 20000:2357089820</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http run request: "/search.php?"</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream check client, write event:1, "/search.php"</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream recv(): -1 (11: Resource temporarily unavailable)</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream request: "/search.php?"</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream send request handler</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream send request</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 chain writer buf fl:0 s:896</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 chain writer in: 081838B4</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 writev: 896</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 chain writer out: 00000000</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 event timer del: 8: 2357089820</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 event timer add: 8: 40000:2357109821</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream request: "/search.php?"</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http upstream process header</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 malloc: 084258E8:32768</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 recv: fd:8 0 of 32768</p>
<p>2009/05/29 16:10:18 [error] 8745#0: *36 upstream prematurely closed connection while reading response header from upstream, client: 10.10.10.101, server: myserver, request: "GET /search.php HTTP/1.1", upstream: "fastcgi://1.1.1.2:5555", host: "ric"</p>
<p>2009/05/29 16:10:18 [debug] 8745#0: *36 http next upstream, 2</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p>Проделывал всё, вплоть до того, что искомый скрипт /search.php разместил по указанному в DOCUMENT_ROOT пути на обеих машинах.</p>
<p>Безрезультатно.</p>
<p><br></p>
<p><br></p>
<p>Подскажите пожалуйста, что не так, и как правильно использовать несколько разных fastcgi серверов если они находятся на разных серверах ?</p>
<p><br></p>
<p>Может дело в каких то передаваемых в nginx location параметрах скрипту.</p>
<p>И уточните пожалуйста, где должен лежать сам исполняемый скрипт, на сервере с nginx или на серверах где подняты fasctgi.</p>
<p><br></p>
<p><br></p>
<p>Большое человеческое спасибо.</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts6>-- </span></p>
<p><span class=rvts6>Best regards,</span></p>
<p><span class=rvts6>Aleksej </span></p>
<p><span class=rvts6>ICQ: 293-686-24</span></p>
<p><span class=rvts6>GSM:371-293-686-24</span></p>
</body></html>