Fixing 502 Bad Gateway Nginx

  Рет қаралды 92,421

Bobby Iliev

Bobby Iliev

Күн бұрын

This video shows you how to fix the 502 Bad gateway and "connect() failed (111: Connection refused) while connecting to upstream" Nginx errors!
Useful links:
Affiliate link for $100 free credit for DigitalOcean so you could spin up your own servers:
m.do.co/c/2a9b...
How to Troubleshoot Common Nginx Issues on Linux Server:
www.digitaloce...
More useful Nginx discussions:
www.digitaloce...
www.digitaloce...
Twitter:
/ bobbyiliev_

Пікірлер: 62
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
If you have any questions feel free to reach out to me! 🙌 Best way to do that is to post a question on the DigitalOcean community forum here: www.digitalocean.com/community/questions
@GlaucoHass
@GlaucoHass 4 жыл бұрын
I just have to say that this video is incredibly well done, very simple and yet well put steps for everything, to the point of feeling embarrassed after you watch, because those steps should really be simple and make sense right away. Thank you very much.
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
Thank you very much for your feedback! I am really happy to hear that this helped you!
@BruceWayne-cb8xj
@BruceWayne-cb8xj 4 жыл бұрын
Brilliant! This video helped me a lot. Thank you and keep it up👍
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
Thanks! Happy to hear that this was helpful! 🙌
@xinyansun9174
@xinyansun9174 4 жыл бұрын
Thank you so much! I followed your steps and it was indeed because I accidentally closed my node server. Now I feel stupid
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
No problem at all! Thank you for the nice feedback and happy to hear that this helped you!
@johntovor605
@johntovor605 3 жыл бұрын
Thank you so much Champ. You have saved me a lot. Great solution.
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
No problem at all! Happy to hear that this was helpful!
@RajeshShrestha-sc4io
@RajeshShrestha-sc4io Жыл бұрын
Very Useful. Thank you for the video.
@muhammadshehroze6691
@muhammadshehroze6691 Жыл бұрын
i have same problem but u give solution for docker file , how i can solve it in ubuntu cli terminal
@paulrodaslema
@paulrodaslema 2 жыл бұрын
Very useful and meaningful content, THANKS!
@bobbyiliev_
@bobbyiliev_ 2 жыл бұрын
Glad you liked it!
@alexgodwin5806
@alexgodwin5806 3 жыл бұрын
Thanks a lot Bobby Iliev
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
You are welcome!
@mohamedaly9096
@mohamedaly9096 2 жыл бұрын
well that's great. but i can't connect to the nginx this way, it there a way to do that on aws console?
@suneel1875
@suneel1875 3 жыл бұрын
hello, what would you do for node js backend server?
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Hi there, you would need to make sure that the Node js service is up and running. If it is not running you would need to check the logs and see why it has crashed.
@suneel1875
@suneel1875 3 жыл бұрын
@@bobbyiliev_ I have posted the question in digital ocean. Waiting for your response :) www.digitalocean.com/community/questions/502-bad-gateaway-nginx
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
@@suneel1875 Hi there, just posted a reply 🙌
@ramn4775
@ramn4775 Жыл бұрын
Hi,I got 502 bad gateway nginx error on browser after calling DRF api..can you plz tell me how to fix this
@aslanhuseynov3481
@aslanhuseynov3481 3 жыл бұрын
Hello bro. when I type sudo cat /etc/nginx/sites-enabled/default there is a error like this: cat: /etc/nginx/sites-enabled/default: No such file or directory . what is wrong? thank you very much.
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Hi there 👋, what OS are you using? You can check the OS with this command: cat /etc/os-release
@aslanhuseynov3481
@aslanhuseynov3481 3 жыл бұрын
@@bobbyiliev_ Linux / Ubuntu.
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
@@aslanhuseynov3481 Hello, it is possible that you have a different Nginx configuration file in there with another name. Use the ls command to check the files in there: ls -l /etc/nginx/sites-enabled/
@aslanhuseynov3481
@aslanhuseynov3481 3 жыл бұрын
@@bobbyiliev_ Hello, yes i have a different nginx configuration file which I wanted to create a new project. but this file is not texted as you have. thank you for your answer. i will wait.
@mananvirmani1243
@mananvirmani1243 3 жыл бұрын
thanks for the video!! helped me a lot!!
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Really happy to hear that it was helpful!
@Zylaqueza
@Zylaqueza 3 жыл бұрын
I create my Wordpress site before for scratch. And a few weeks ago. I put some DNS in my ethernet section. There is no problem with that or i need to change what DNS I put ? I put only 1.1.1.1 and 1.0.0.1 for internet download speed purpose. And yesterday I see my Wordpress site exprncing 502 nginx error. Although my Wordpress version was old. I update it and all plugins. But instead I resolve my problem it's goes to Maintenance.
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Hi there, the 502 error is not likely caused by the DNS change. I would recommend checking if the PHP FPM service is up and running on the server. If not make sure to start it.
@rafatahmed1126
@rafatahmed1126 3 жыл бұрын
saved my day thanks
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Really happy to hear that!
@pravallikachevuru7145
@pravallikachevuru7145 3 жыл бұрын
Hi please answer my question.. Iam struggling from last week's. Iam using gke clustee, configured nginx ingress controller, 2 applications are deployed to gke container ports are for http: 8081, https: 8088, I have configured ingress rules but got 502 bad gate way. How to troubleshoot this?? How to start the backend service Helpme with this befor my manager fire me
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Make sure to check your logs first to see the actual error. If the applications are deployed, make sure that the ports are actually exposed correctly and also make sure that the applications are running.
@pravallikachevuru7145
@pravallikachevuru7145 3 жыл бұрын
@@bobbyiliev_ I acn able to access the application with type load balancer. But iam unable to access to acces with ingress. I check the logs of ingress pod. It's showing the error as "http/1.1 connection refused while connecting to upstream"
@muskangupta1977
@muskangupta1977 Жыл бұрын
Whaat is the equivalent cmd to docker ps -a for nodejs server
@jaybhatia5581
@jaybhatia5581 3 жыл бұрын
Do i need to install docker 1st??
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
No, docker is just used as an example here. If you are running an app like Node.js or PHP FPM then you need to make sure that the application is started.
@princezzdaniella3348
@princezzdaniella3348 3 жыл бұрын
I just got error bad gateway omg how do u fix that
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Best thing to do is to check your Nginx error log first to see the actual problem rather than the generic error: tail -100 /var/log/nginx/error.log
@jothamsinyanya6954
@jothamsinyanya6954 3 жыл бұрын
Thank you. This was very helpful.
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
No problem! Happy to hear that it helped!
@petergriffin8767
@petergriffin8767 4 жыл бұрын
very helpful ty
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
No problem at all! Happy to hear that this helped!
@awetinodaily7084
@awetinodaily7084 4 жыл бұрын
How can i came to this page
@bobbyiliev_
@bobbyiliev_ 4 жыл бұрын
Hi there, You would need to first SSH to the server.
@mmusiphuti3261
@mmusiphuti3261 2 жыл бұрын
very helpfull
@bobbyiliev_
@bobbyiliev_ 2 жыл бұрын
Glad to hear that!
@maryamalmutairi1797
@maryamalmutairi1797 2 жыл бұрын
i have the same port in the container and nginx.conf so what to do ? its still show me bad getway
@bobbyiliev_
@bobbyiliev_ 2 жыл бұрын
What do you see in your error logs?
@AmerMaraqa
@AmerMaraqa 4 жыл бұрын
Hello Thanks for the great video! } location @puma { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_pass 127.0.0.1:5000; } Im getting a service that is running on port 5000. I checked online and found that it is FLASK service that use by default port 5000. Do you have any idea how to restore it? Please notice that received this error on a SMTP server with postal application and nothing else installed. Any ideas on what to do next ? Thank you
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
Hi there, as far as I can see form the config it looks like that the backend service is puma. It would depend on how puma is setup, but if there is a systemd service for it you could start it with: systemctl restart puma
@UgiloySaidova-pc4wb
@UgiloySaidova-pc4wb 4 ай бұрын
Ок зур❤
@Jankhcr2
@Jankhcr2 3 ай бұрын
I am on mobile😢
@orlandoubilla7055
@orlandoubilla7055 2 ай бұрын
Just start local container? lol this is not a real problem...
@UgiloySaidova-pc4wb
@UgiloySaidova-pc4wb 4 ай бұрын
Зур❤ ОК
@noetim1284
@noetim1284 3 жыл бұрын
I DONT HAVE A DOCKER ID. tf im supposed to do now
@bobbyiliev_
@bobbyiliev_ 3 жыл бұрын
You need to start your backend service. In the video I mention that it is not necessarily docker. What is the proxy rule in your Nginx server block?
@jp_doner
@jp_doner 2 жыл бұрын
Not useful at all
@bobbyiliev_
@bobbyiliev_ 2 жыл бұрын
Sorry to hear that, feel free to share more details about your problem and I will be happy to advise you further!
@AlexyMiro
@AlexyMiro Жыл бұрын
When i type docker ps -a the container is empty. What can i do about it?
The NGINX Crash Course
50:53
Laith Academy
Рет қаралды 503 М.
How to fix Nginx 502 Bad Gateway Error
5:11
Tony Teaches Tech
Рет қаралды 124 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
How to fix 502 Bad Gateway Error
4:39
WPDev
Рет қаралды 95 М.
Learn Proper NGINX Configuration Context Logic
12:56
NGINX
Рет қаралды 51 М.
Problems You will Encounter on Linux (and How to Solve Them)
23:01
Rob Braxman Tech
Рет қаралды 195 М.
✅How To FIX 502 Bad Gateway Error In Google Chrome (2024 Update!)
5:08
How I Got a 100% Free Lifetime Server (And You Can Too!)
4:23
CyberFlow
Рет қаралды 199 М.
NGINX Explained - What is Nginx
14:32
TechWorld with Nana
Рет қаралды 329 М.
[FIXED] Error 502 Bad Gateway Error Problem (100% Working)
5:57
TechinPost
Рет қаралды 385 М.
How to add rate limiting in Ngnix
12:05
Hitesh Choudhary
Рет қаралды 4 М.