<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }p { margin-top: 0px; margin-bottom: 0px; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Yes,it's <font face="Helvetica, Arial"><span style="font-size: 13px; line-height: 19.5px;">of after the </span></font><span style="font-family: Helvetica, Arial; font-size: 13px; line-height: 19.5px; background-color: window;">error_page directive removed.</span></div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span style="font-size: 12px;"><div style="margin: 10px;"><p style="margin: 0px 0cm; orphans: 2; widows: 2; line-height: 21px;"><font face="微软雅黑, sans-serif">Tong</font></p></div></span></div>
<blockquote style="margin-Top: 0px; margin-Bottom: 0px; margin-Left: 0.5em"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:zchao1995@gmail.com">Zhang Chao</a></div><div><b>Date:</b> 2017-12-04 11:26</div><div><b>To:</b> <a href="mailto:nginx@nginx.org">nginx</a></div><div><b>Subject:</b> Re: lua code in log_by_lua_file not executed when the upstream server is down</div></div></div><div><div class="FoxDiv20171204133357437609" style="word-wrap: break-word;">
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi!</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I think you should paste this issue to the openresty mail list <a href="https://groups.google.com/forum/#!forum/openresty-en">https://groups.google.com/forum/#!forum/openresty-en</a> </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">For this problem, have you configured any error_page directives? the error_page will trigger an internal redirect.</div> <br> <div id="bloop_sign_1512357825014112000" class="bloop_sign"></div> <br><p class="airmail_on" style="margin-top: 0px; margin-bottom: 0px;">On 1 December 2017 at 21:10:12, <a href="mailto:tongshushan@migu.cn">tongshushan@migu.cn</a> (<a href="mailto:tongshushan@migu.cn">tongshushan@migu.cn</a>) wrote:</p> <blockquote type="cite" class="clean_bq" style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><span><div><div></div><div>
<div><span>the nginx.conf as below:<br>
<br>
upstream my_server {<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>server localhost:8095;<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>keepalive 2000;<br>
}<br>
<br>
location /private/rush2purchase/ {<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>limit_conn addr 20;<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>proxy_pass <a href="http://my_server/private/rush2purchase/">http://my_server/private/rush2purchase/</a>;<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>proxy_set_header Host $host:$server_port;<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span>rewrite_by_lua_file D:/tmp/lua/draw_r.lua;<br>
<span style="color:rgb(0,0,0);background-color:rgba(0,0,0,0)"> 
  </span><font color="#003366"><b>log_by_lua_file</b> </font>D:/tmp/lua/draw_decr.lua;<br>
}</span></div>
<div><span><br>
when I send request to </span><a href="http://localhost/private/rush2purchase/" style="font-size:10.5pt;line-height:1.5;background-color:window">http://localhost/private/rush2purchase/</a><span style="font-size:10.5pt;line-height:1.5;background-color:window"> </span><span style="font-size:10.5pt;line-height:1.5;background-color:window"> ,it works fine the the stream server is up,</span></div>
<div><span>but when I shutdown the upstream server</span><span style="font-size:10.5pt;line-height:1.5;background-color:window">(port:8095)</span><span style="font-size:10.5pt;line-height:1.5;background-color:window">,I find the code not executed in <b><font color="#003366">log_by_lua_file </font></b>(draw_decr.lua).</span></div>
<div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><br>
</span></div>
<div><b>info in nginx access.log:</b></div>
<div><span>127.0.0.1 - - [01/Dec/2017:21:03:20 +0800] "GET /private/rush2purchase/ HTTP/1.1" <b><font color="#FF0000">504 </font></b>558 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3236.0 Safari/537.36"<br>
</span></div>
<div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><br>
</span></div>
<div><b><span style="font-size:10.5pt;line-height:1.5;background-color:window">error
message in </span><span style="font-size:10.5pt;line-height:1.5;background-color:window">nginx</span><span style="font-size:10.5pt;line-height:1.5;background-color:window">  </span><span style="font-size:10.5pt;line-height:1.5;background-color:window">error.log</span><span style="font-size:10.5pt;line-height:1.5;background-color:window">:</span></b></div>
<div><span>2017/12/01 21:02:20 [error] 35292#42868: *3298 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /private/rush2purchase/ HTTP/1.1", upstream: "http://[::1]:8095/private/rush2purchase/", host: "localhost"<br>
2017/12/01 21:03:20 [error] 35292#42868: *3298 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /private/rush2purchase/ HTTP/1.1", upstream: "<a href="http://127.0.0.1:8095/private/rush2purchase/">http://127.0.0.1:8095/private/rush2purchase/</a>", host: "localhost"<br>
</span></div>
<div><span><br></span></div>
<div><span style="font-size:10.5pt;line-height:1.5;background-color:window">How
to fix it?</span></div>
<div><br></div>
<div><br></div>
<hr style="width:210px;height:1px" color="#B5C4DF" size="1" align="left">
<div>
<div style="margin:10px">
<p style="margin: 0px 0cm; line-height: 21px;">
<span style="font-size:12px"><font face="微软雅黑, sans-serif">Tong</font></span></p>
</div>
</div>
_______________________________________________
<br>nginx mailing list
<br><a href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<br><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></span></blockquote>
</div></div></blockquote>
</body></html>