After few days of server running fine with nginx it start throwing 499 and 502
- by Abhay Kumar
Nginx start throwing 499 and 502 after running fine for few days, website is a rails app using thin as the webserver. Restarting the Nginx doent not seem to help. Below the the Nginx config
Nginx config under sites-enabled
upstream domain1 {
least_conn;
server 127.0.0.1:3009;
server 127.0.0.1:3010;
server 127.0.0.1:3011;
}
server {
listen 80; # default_server;
server_name xyz.com *.xyz.com;
client_max_body_size 5M;
access_log /home/ubuntu/www/xyz/current/log/access.log;
root /home/ubuntu/www/xyz/current/public/;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_read_timeout 150;
if (!-f $request_filename) {
proxy_pass http://domain1;
break;
}
}
}