# Nginx post ONE request to one more upstream\_addr

**URL:** <https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323>\
**Category:** NGINX\
**Created:** [June 15, 2011, 8:38am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323 "2011-06-15T08:38:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 15, 2011, 8:38am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323/1 "2011-06-15T08:38:35Z")

</div>

hi, everyone,

# nginx version is 0.8.53, configure (http definition) is :

http{  
upstream my\_loads {  
server 10.10.1.12;  
server 10.10.1.13;  
}

```
log_format combined_addsvr '$remote_addr - $remote_user 

```

[$time\_local] ’  
'“$request” $status $body\_bytes\_sent ’  
'“$http\_referer” “$http\_user\_agent”  
$upstream\_addr  
$upstream\_cache\_status ';  
access\_log logs/access.log combined\_addsvr;

```
server {
    listen 80;
    server_name mytest.com;
    client_max_body_size 100m;
    proxy_buffering off;
    proxy_read_timeout 120;
    proxy_send_timeout 120;
    client_body_timeout 120;
    send_timeout 120;

    location / {
        proxy_pass http://my_loads/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

```

===========================================

there is a strange line in log file: (sorry to use xxx replace of true  
url)  
192.168.1.1 - - [14/Jun/2011:20:53:24 +0800] “POST /1.php HTTP/1.1” 200  
3729558 “[mytest.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;my test Resources and Information.](http://mytest.com/xxx)” “Mozilla/4.0 (compatible; MSIE 7.0;)”  
10.10.1.12:80, 10.10.1.13:80 -

when nginx deals with 1.php, it sends POST to all upstream servers!

the next is normal log:  
192.168.1.1 - - [14/Jun/2011:20:53:44 +0800] “POST /1.php HTTP/1.1” 302  
2 "  
[mytest.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;my test Resources and Information.](http://mytest.com/xxx)" “Mozilla/4.0 (compatible; MSIE 7.0;)”  
10.10.1.12:80 -

Could anyone tell me if it is a bug or just any configure improperly?  
thanks.

---

<div class="post-metadata">

**Author:** ![MaLi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@MaLi](https://www.ruby-forum.com/u/MaLi)\
**Post date:** [June 15, 2011, 9:50am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323/2 "2011-06-15T09:50:17Z")

</div>

Hello!

On Wed, Jun 15, 2011 at 02:38:08PM +0800, MaLi wrote:

> ```
> proxy_buffering off;
> }
> 
> ```
> 
> 192.168.1.1 - - [14/Jun/2011:20:53:44 +0800] “POST /1.php HTTP/1.1” 302 2 "  
> [http://mytest.com/xxx](http://mytest.com/xxx)" “Mozilla/4.0 (compatible; MSIE 7.0;)” 10.10.1.12:80 -
> 
> Could anyone tell me if it is a bug or just any configure improperly?  
> thanks.

nginx will retry request on next upstream server if first one  
failed, see here:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Maxim D.

---

<div class="post-metadata">

**Author:** ![MaLi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@MaLi](https://www.ruby-forum.com/u/MaLi)\
**Post date:** [June 15, 2011, 10:03am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323/3 "2011-06-15T10:03:52Z")

</div>

Thanks Dounin,

actually, both 10.10.1.12 and 10.10.1.13 received the POST items with  
1.php  
(so repeat ran the script) ,  
and why both servers being recorded as Upstream\_addr in the log file?

2011/6/15 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![MaLi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@MaLi](https://www.ruby-forum.com/u/MaLi)\
**Post date:** [June 15, 2011, 10:19am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323/4 "2011-06-15T10:19:19Z")

</div>

oh, I see,

Maybe the POST data is too big, then first upstream server cannot  
response  
in time. I forgot to point one fact , that is one server maybe only  
receive  
part of POST data.

thanks again, Dounin.

2011/6/15 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![MaLi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@MaLi](https://www.ruby-forum.com/u/MaLi)\
**Post date:** [June 15, 2011, 10:07am UTC](https://www.ruby-forum.com/t/nginx-post-one-request-to-one-more-upstream-addr/208323/5 "2011-06-15T10:07:35Z")

</div>

Hello!

On Wed, Jun 15, 2011 at 04:03:30PM +0800, MaLi wrote:

> Thanks Dounin,
> 
> actually, both 10.10.1.12 and 10.10.1.13 received the POST items with 1.php  
> (so repeat ran the script) ,

Most likely it’s failed to respond in time, and that’s why nginx  
retried request. Don’t hesitate to look into error\_log, it should  
has details.

> and why both servers being recorded as Upstream\_addr in the log file?

Variable $upstream\_addr should contain addresses of all upstream  
servers tried, this is how it works.

Maxim D.

> > > 
> > 
> > ’
> > 
> > > ```
> > > proxy_buffering off;
> > > }
> > > 
> > > ```
> > > 
> > > the next is normal log:
> > 
> > [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpProxyModule#proxy_next_upstream)
> > 
> > Maxim D.
> > 
> > * * *
> > 
> > nginx mailing list  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)
