A
A
Alexey K.2015-04-03 13:42:08
Nginx
Alexey K., 2015-04-03 13:42:08

Why does nginx get a 502 error as a proxy to apache?

Good afternoon.
For tests, I installed NGINX on the server as a proxy to Apache.
Installed as PHP and Mysql.
There is only Wordpress on the server, the user is just me.
From time to time a 502 error occurs, in the logs it looks something like this:
17531#0: *10768 upstream prematurely closed connection while reading response header from upstream, client: 000.000.0.000, server: servername.com, request: "POST /wp-cron .php?doing_wp_cron=1428047949.5712959766387939453125 HTTP/1.0", upstream: " 127.0.0.1:8088/wp-cron.php?doing_wp_cron=142804794 ... ", host: "servername.com"
and so to speak randomly.
I read what it can be if large headers are transmitted, and you need to increase the buffer size.
Below is the Apache and Nginx-a configs.
on Gist:
httpd config
Nginx config
or dropbox
https://www.dropbox.com/s/ay4bowjcefcaukz/httpd.co...
https://www.dropbox.com/s/h4ujy86knvu447h/nginx.co...
Can anyone help with this error?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
polozad, 2015-04-03
@polozad

lient_max_body_size 10m?

P
Puma Thailand, 2015-04-03
@opium

It is logical that cron runs for a long time and falls off in php by timeout
Stupid decision to increase the timeout in nginx and php settings
Smart launch of cron in wordpress is not stupid through a web server, but directly from the system cron by running a php file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question