Welcome! Log In Create A New Profile

Advanced

502 in Nginx as a reverse proxy whithout cache

August 01, 2013 04:39AM
Hi,

Currently, we use Nginx as a reverse proxy without cache. Last monday we've rolled out a new version of PHP application which has appeared a several 502 errors.

First of all, i've applied the workaround explained in thread http://forum.nginx.org/read.php?2,188352 . The number of 502 have falled down but we can see a several 502 yet, but we haven't any error log now in the nginx.

This is Nginx parameters applied:
{code}
## Size Limits
client_body_buffer_size 128K;
client_header_buffer_size 1M;
client_max_body_size 1M;
large_client_header_buffers 8 8k;

## Timeouts
client_body_timeout 600;
client_header_timeout 600;
expires 24h;
keepalive_timeout 60 60;
send_timeout 600;

## TCP options
tcp_nodelay on;
tcp_nopush on;

## Proxy caching options
proxy_buffering on;
proxy_buffers 16 16k;
proxy_buffer_size 32k;

fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;

proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
{code}


This is the trace lines in acces log of Nginx and Apache:

Las trazas son estas:
NGINX
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
{code}
2.139.8.108 - - [31/Jul/2013:23:19:31 +0200] "GET /es/descuentos-malaga/oferta-pelsandbody-masaje-tailandes-aromaterapia.html?mktc=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&utm_campaign=AAAAA&utm_content=AAAAAAA&utm_medium=email&utm_source=ExactTarget&email=emailbos@provider.com&date=AAAAAAA&AL_Hash=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&utm_referrer= HTTP/1.1" 502 118 "http://es.example.com/descuentos-malaga/oferta-pelsandbody-masaje-tailandes-aromaterapia.html?mktc=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&utm_campaign=AAAAA&utm_content=AAAAAAA&utm_medium=email&utm_source=ExactTarget&email=emailbos@provider.com&date=AAAAAAA&AL_Hash=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "Mozilla/5.0 (Linux; U; Android 2.3.3; es-es; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" "-"
{code}

LogFormat "\"%{True-Client-IP}i\" %h %t %T \"%r\" %>s %b %{outstream}n/%{instream}n (%{ratio}n%%) \"%{Referer}i\" \"%{Expires}o\" \"%{Cache-Control}o\" \"%{User-Agent}i\" \"%{Host}i\" \"%{X-Forwarded-For}i\" %{mod_php_memory_usage}n %P" itsysprod

APACHE
{code}
"-" 10.253.1.61 [31/Jul/2013:23:19:31 +0200] 0 "GET /es/descuentos-malaga/oferta-pelsandbody-masaje-tailandes-aromaterapia.html?mktc=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&utm_campaign=AAAAA&utm_content=AAAAAAA&utm_medium=email&utm_source=ExactTarget&email=emailbos@provider.com&date=AAAAAAA&AL_Hash=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA HTTP/1.0" 200 303 285/475 (60%) "http://es.example.com/descuentos-malaga/oferta-pelsandbody-masaje-tailandes-aromaterapia.html?mktc=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&utm_campaign=AAAAA&utm_content=AAAAAAA&utm_medium=email&utm_source=ExactTarget&email=emailbos@provider.com&date=AAAAAAA&AL_Hash=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "Thu, 19 Nov 1981 08:52:00 GMT" "no-store, no-cache, must-revalidate, post-check=0, pre-check=0" "Mozilla/5.0 (Linux; U; Android 2.3.3; es-es; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" "m.example.com" "2.139.8.108, 10.253.1.60" 786432 30962
{code}

Platform description
# cat /etc/redhat-release
CentOS release 6.3 (Final)
# uname -a
Linux balance01-prod 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
# nginx -v
nginx version: nginx/1.2.4
Subject Author Posted

502 in Nginx as a reverse proxy whithout cache

marc.cortinas August 01, 2013 04:39AM

Re: 502 in Nginx as a reverse proxy whithout cache

marc.cortinas August 01, 2013 06:53AM

Re: 502 in Nginx as a reverse proxy whithout cache

marc.cortinas August 02, 2013 08:25AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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