I created my own AWS EC2 instance yesterday, and it was working all fine and dandy. Today I went to use it again and I received the 502 error.
(I don’t know if this is the reason, but I installed some code listed here: https://blog.quantinsti.com/install-ta-lib-python/
twice. Why ? I didn’t even need to do it, I’m just an idiot. It stopped working almost immediately after I did this)
This is my error log when i enter the command : sudo tail -30 /var/log/nginx/error.log
2021/05/26 00:30:53 [error] 487#487: *2 connect() failed (111: Connection refused) while connecting to upstream, clien(base(ba((b((bas(ba(ba((ba((b(b(((b((b(b((b(((b(((((((((((((((((base) (base) u(ba(base(base) ubu(
Otherwise, could it be that my memory usage is at 99.8%? Just thinking of potential problems.
Any help would be supremely appreciated.
Edit: Below is my sites available (/etc/nginx/sites-available/jupyter_app.conf):
server {
server_name jupyter_notebook;
listen 80;
listen [::]:80;
location / {
include proxy_params;
proxy_pass http://localhost:8888;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
}
2
Answers
Check if the connection settings to upstream is correct.
Also you can check the memory usage by using:
And this will show you the disk space if the disk space is full try to delete the log files or irrelevant files and check if the site works.
Is your upstream application running and accepting connections?
Check in your machine whether the below service and port is up and listening for connections, if not start that upstream service:
To check open port status, run the below command: