502 Bad Gateway, nginx/0.7.67 as response to my website
I am running a site through Linode Server. The recent maintenance change caused an error in some setting I cannot understand. The Linode Management panel says that everything is running, but when I look at the site and try to access it I get the following error
502 Bad Gateway
I have no clue what it is and Linode support basically say they do not understand it either and cannot help.
I have been working with the Putty thing and do get some access, but from there ( the sites prompt $) I do not understand how to move further.
Further, the site is running, but I would like to get all the files, and see how new developments can be carried out on it. The site is created in Python and Django.
Anyone with expertise on that?
Tim advised": "to configere the web application to start automatically at boot. It sounds like my web server, Nginx, is unable to communicate with the backend web application."
However, I have no clue what that is, how to get access and what the variables are for setting this to auto boot once Linode server is rebooted.
When nginx receives a request from a browser it passes that request to your application server. If it can't reach the application server then it returns the 502 Bad Gateway error to the browser.
So, in a nutshell, you appear to have nginx started but no application server.
To make things easy for now you should just run nginx with gunicorn as your app server. Some decent instructions for setting this up can be found at
Your instructions helped me to dig deeper into the server itself, I used additional guidance on basic unix commands to move between directories and list the files.
Apparently the sudo command you suggested to restart nginx did work for the restart, but the website is still showing the same message. Also a sudo reboot command did let the application server reboot, but still no success in accessing the website.
Perhaps I need to do more, but then the link you provided is showing too many options I guess. And the gunicorn is also completely new and has not been in place before. So I am not sure I need it at all. So any further help would be appreciated very much.
In particular, how can I find and restart the application server?
In the meanwhile, with other commands to read the log file, I could detect one error in the nginx error log file:
2013/08/13 21:16:40 [error] 1676#0: *1 connect() failed (111: Connection refused ) while connecting to upstream, client: 220.127.116.11, server: r4c.clinicaltemplates.org, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:8082", host: "r4c.clinicaltemplates.org"
Perhaps this points to the next step? But again, I do not know where to go.