<html><body><span style="display:block;" class="xfm_04303404"><div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Hi all,</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">I would really appreciate it if you could help me with nginx.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">The situation is:</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Nginx (v. 1.14.2) redirects the request to the application server. In case this request with the POST method and the application server gives an error code 500, the response is transmitted to the client.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">But nginx then makes a second request. Is there any way to disable execution of the second </span><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">request by</span><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;"> nginx?</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Many thanks in advance.<br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;"><span style="font-family:Arial;">Here is a part of nginx file:</span></span><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">#Makes upstream to the branch with response code 500</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">upstream test5 {</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       server 127.0.0.1:90;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       keepalive 20;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">}</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">#virtualhost that issues response code 500;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">server {</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">   listen 90 default_server;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">   server_name localhost;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">   root /home/jetty/www;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;">
<div><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       location @intercept_disabled {</span></div>
<div><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">               proxy_intercept_errors off;</span></div>
<div><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">               proxy_pass <a href="http://test5/" target="_blank" rel="noreferrer noopener">http://test5</a>;</span></div>
<div><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       }</span></div>
<div><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;"><br/></span></div>
</div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">   location /test500 {</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       return 500;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       error_page 500 /500.html;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">   }</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">}</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;"># Redirection to virtualhost that issues response code 500;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       location /test500 {</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">           proxy_pass <a href="http://test5/" target="_blank" rel="noreferrer noopener">http://test5</a>;</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">       }</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">================================</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Request and responses:</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">================================</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">curl -i -X POST localhost/test500</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">HTTP/1.1 500 Internal Server Error</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Server: nginx</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Date: Wed, 13 Nov 2019 14:21:25 GMT</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Type: text/html</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Length: 13</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Connection: close</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">ETag: "5dcbd0b0-d"</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;"><span style="font-family:Arial;">ERROR 500 page.</span></span><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">ngrep -qiltW byline -s 1000 -c 1024 -d lo '' port 90</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">T 2019/11/13 14:25:08.751892 127.0.0.1:44416 -> 127.0.0.1:90 [AP] #4</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">POST /test500 HTTP/1.1.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">X-Forwarded-For: 127.0.0.1.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Host: localhost.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">X-Forwarded-Proto: http.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">User-Agent: curl/7.58.0.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Accept: */*.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">T 2019/11/13 14:25:08.752038 127.0.0.1:90 -> 127.0.0.1:44416 [AFP] #6</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">HTTP/1.1 500 Internal Server Error.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Server: nginx.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Date: Wed, 13 Nov 2019 14:25:08 GMT.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Type: text/html.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Length: 13.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Connection: close.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">ETag: "5dcbd0b0-d".</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">ERROR 500 page.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">T 2019/11/13 14:25:08.752139 127.0.0.1:44418 -> 127.0.0.1:90 [AP] #12</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">POST /test500 HTTP/1.1.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">X-Forwarded-For: 127.0.0.1.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Host: localhost.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">X-Forwarded-Proto: http.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">User-Agent: curl/7.58.0.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Accept: */*.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">T 2019/11/13 14:25:08.752221 127.0.0.1:90 -> 127.0.0.1:44418 [AFP] #14</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">HTTP/1.1 500 Internal Server Error.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Server: nginx.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Date: Wed, 13 Nov 2019 14:25:08 GMT.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Type: text/html.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Content-Length: 13.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">Connection: close.</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">ETag: "5dcbd0b0-d".</span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;"><span style="font-family:Arial;">ERROR 500 page.</span></span><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;font-weight:400;white-space:normal;line-height:12pt;"><br/></span></div>
<div style="text-align:left;white-space:normal;background-color:#ffffff;"><span style="color:#000000;font-size:10pt;white-space:normal;line-height:12pt;font-family:Arial;">So, in the response we see that nginx makes second request.</span></div>
</div></span></body></html>