recv() 502 bad gateway -Nginx +PHP7.4-fpm, Google Cloud ubuntu instance - nginx

I got 502 bad gateway same issue on php7.4-fpm:
*3459 recv() failed (104: Connection reset by peer) while reading response
header from upstream, client: {ip address}, server: {xxx.zzz.com}, request: "GET /xxx/yyy HTTP/1.1", up
stream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "{xxx.zzz.com}"
I run this server on google cloud VM instance nginx env.
Please let me know how can I fix this issue.
Thank you

Related

Request on k8s NGINX ingress controller fails with "upstream sent too big header while reading response header from upstream"

When I try to send a request through my NGINX ingress with headers larger than 4k, it returns a 502 error:
[error] 39#39: *356 upstream sent too big header while reading response header from upstream,
client: <ip>,
server: <server>,
request: "GET /path/ HTTP/1.1",
subrequest: "/_external-auth-Lw",
upstream: "<uri>",
host: "<host>"
[error] 39#39: *356 auth request unexpected status: 502 while sending to client,
client: <ip>,
server: <server>,
request: "GET /path/ HTTP/1.1",
host: "<host>"
I've followed instructions about how to allegedly resolve this issue by configuring the proxy-buffer-size in the ingress controller (nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"), but it doesn't seem to work. The only thing that I can think of, is that it has something to do with the proxy-buffer-size of the subrequest, which doesn't seem to get set.
The proxy_buffering header wasn't being set on the /_external-auth-Lw endpoint in the NGINX config. Issue has been resolved as of v. 0.14.0.

502 Bad Gateway Issue - Using Nginx and Jenkins

I'm facing a problem with one server mine. I have a configuration of a Jenkins application running under Nginx in a Ubuntu OS.
But after updating Jenkins to a new version, when I try to reach my Jenkins web application, I get this error:
"502 Bad Gateway - nginx/1.14.0 (Ubuntu)"
Apparently all my configuration are okay.
How can I solve it?
Nginx error log:
2019/04/24 16:20:02 [error] 11424#11424: *2 connect() failed (111: Connection refused) while connecting to upstream, client: yyy.yy.yyy.yy, server: xx.xx.xxx.xxx, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "xx.xx.xxx.xxx", referrer: "http://xx.xx.xxx.xxx/"

Connection reset by peer by NGINX

Hello I have a php dashboard of stream streams that uses php-fpm + NGINX however when using the ondmand function the NGINX returns me the following error described below.
2019/02/19 14:51:19 [error] 1214#0: *438 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 186.208.107.243, server: , request: "GET /live/thythy20/60628227/166.ts HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "goldpremium.ddns.net:8080"
Those who can help me are very grateful!

What nginx server config exactly should be for Nuxt.js Universal project?

I've got big troubles with deploy my nuxt.js project on Ubuntu with Nginx;
Ubuntu 18.04 + nginx
Nuxt.js 2.3.2 (universal mode)
So maybe somebody can help me to resolve my problem)
I will to describe all things around this problem below:
My nuxt.conf build part
My nginx config
Then I run this command in ssh
sudo npm run build
sudo pm2 start npm --name "nuxt" -- start
Now server is listening localhost:3000, as I wrote in package.json
After all this I've got 500 error in console, when I open my site.
Server error
nginx error.log
2018/11/26 04:48:42 [error] 15032#15032: *5773 upstream prematurely closed connection while reading response header from upstream, client: 173.267.244.9, server: example.com, request: "GET /seller HTTP/1.1", upstream: "http://127.0.0.1:3000/seller", host: "example.com"
2018/11/26 04:48:42 [error] 15032#15032: *5773 connect() failed (111: Connection refused) while connecting to upstream, client: 173.267.244.9, server: example.com, request: "GET /seller HTTP/1.1", upstream: "http://[::1]:3000/seller", host: "example.com"
2018/11/26 04:48:43 [error] 15032#15032: *5773 no live upstreams while connecting to upstream, client: 173.267.244.9, server: example.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://localhost/favicon.ico", host: "example.com", referrer: "http://example.com/seller"
So now I have no idea whats wrong with that. Help me please.
It seems that Nginx tries to connect on the IPv6 loopback [::1], and nodejs is probably just listening on IPv4.
Try setting 127.0.0.1 instead of localhost

HHVM stops working, (111: Connection Refused) message on Nginx with PageSpeed

I've recently set up a WordPress blog on a VPS with Ubuntu 12.04 LTS, HHVM, Nginx (with the PageSpeed module included), and MariaDB. Everything runs really fast, but in the last few days I've noticed that HHVM stops working suddenly and from that moment the error.log shows first this message:
2014/09/18 12:27:56 [error] 24442#0: *121276 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 150.146.136.21, server: xxxxx.com, request: "POST /wp-login.php?PageSpeed=noscript HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "xxxxx.com"
and then several messages with URLs corresponding to articles people are trying to read, but always with a 111 error:
2014/09/18 14:03:28 [error] 24442#0: *133594 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.121, server: xxxxx.com, request: "GET /2008/11/27/thanksgiving-whatever/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxxx.com"
I'd say it has something to do with the PageSpeed module, but why is HHVM affected and not Nginx? DO you have some hint?
Thank

Resources