Welcome! Log In Create A New Profile

Advanced

Re: nginx post ONE request to one more upstream_addr

MaLi
June 15, 2011 04:20AM
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 Dounin <mdounin@mdounin.ru>

> 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 Dounin
>
> >
> >
> >
> > 2011/6/15 Maxim Dounin <mdounin@mdounin.ru>
> >
> > > Hello!
> > >
> > > On Wed, Jun 15, 2011 at 02:38:08PM +0800, MaLi wrote:
> > >
> > > > 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 "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 "
> > > > 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:
> > >
> > > http://wiki.nginx.org/HttpProxyModule#proxy_next_upstream
> > >
> > > Maxim Dounin
> > >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx@nginx.org
> > > http://nginx.org/mailman/listinfo/nginx
> > >
>
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx post ONE request to one more upstream_addr

MaLi June 15, 2011 02:40AM

Re: nginx post ONE request to one more upstream_addr

Maxim Dounin June 15, 2011 03:52AM

Re: nginx post ONE request to one more upstream_addr

MaLi June 15, 2011 04:04AM

Re: nginx post ONE request to one more upstream_addr

Maxim Dounin June 15, 2011 04:08AM

Re: nginx post ONE request to one more upstream_addr

MaLi June 15, 2011 04:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
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