Welcome! Log In Create A New Profile

Advanced

502 Bad Gateway

Posted by pravinxyz 
502 Bad Gateway
November 20, 2015 10:21AM
Hi All,

I have spend a lot of time to find the fix for the error. Its been noted that this happens only when i try to upload a zip file which is above 56KB.

The sever works fine till i have 55KB of file uplaoded. I have tried chaning many parametrs tofix this but does not work.

I am using ngnix mojolicious reverse proxy

My configs and Erros

upstream ppp {
server 127.0.0.1:8080 max_fails=10 fail_timeout=60s;
}
server {
listen 80;
server_name localhost;
client_max_body_size 90000M;
access_log /var/log/nginx/ppp.log main;
error_log /var/log/nginx/ppp.error.log;
location / {
proxy_pass http://ppp;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "http";
proxy_buffers 32 16k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
}
}


user nginx;
worker_processes 4;
worker_rlimit_nofile 8192;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 4096;
multi_accept on;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;
# ADDED
include /etc/nginx/conf.d/*.conf;

}



### Errors


Failed upload file 'Automation.zip' because of "Bad Gateway". Response: "<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.0</center>
</body>
</html>
"



###


2015/11/20 10:13:18 [error] 6281#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 10.x.x.x.x, server: localhost, request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "10.y.y.y"
Re: 502 Bad Gateway
November 20, 2015 10:28AM
If upstream returns the error then that's where the problem lays, have you checked if your upstream has set some limits somewhere?

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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