Fixing 502 Bad Gateway Nginx

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 61

  • @bobbyiliev_
    @bobbyiliev_  4 ปีที่แล้ว +5

    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 3 ปีที่แล้ว +2

    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_  3 ปีที่แล้ว +1

      Thank you very much for your feedback! I am really happy to hear that this helped you!

  • @BruceWayne-cb8xj
    @BruceWayne-cb8xj 4 ปีที่แล้ว +2

    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 3 ปีที่แล้ว +2

    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_  3 ปีที่แล้ว

      No problem at all! Thank you for the nice feedback and happy to hear that this helped you!

  • @paulrodaslema
    @paulrodaslema 2 ปีที่แล้ว +1

    Very useful and meaningful content, THANKS!

  • @RajeshShrestha-sc4io
    @RajeshShrestha-sc4io ปีที่แล้ว

    Very Useful. Thank you for the video.

  • @johntovor605
    @johntovor605 3 ปีที่แล้ว +1

    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!

  • @aslanhuseynov3481
    @aslanhuseynov3481 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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.

  • @alexgodwin5806
    @alexgodwin5806 3 ปีที่แล้ว +1

    Thanks a lot Bobby Iliev

  • @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

  • @muhammadshehroze6691
    @muhammadshehroze6691 ปีที่แล้ว

    i have same problem but u give solution for docker file , how i can solve it in ubuntu cli terminal

  • @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?

  • @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.

  • @mananvirmani1243
    @mananvirmani1243 3 ปีที่แล้ว +1

    thanks for the video!! helped me a lot!!

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว +1

      Really happy to hear that it was helpful!

  • @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"

  • @suneel1875
    @suneel1875 3 ปีที่แล้ว

    hello, what would you do for node js backend server?

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      @@suneel1875 Hi there, just posted a reply 🙌

  • @rafatahmed1126
    @rafatahmed1126 3 ปีที่แล้ว +2

    saved my day thanks

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว +1

      Really happy to hear that!

  • @jothamsinyanya6954
    @jothamsinyanya6954 3 ปีที่แล้ว +1

    Thank you. This was very helpful.

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว

      No problem! Happy to hear that it helped!

  • @muskangupta1977
    @muskangupta1977 ปีที่แล้ว

    Whaat is the equivalent cmd to docker ps -a for nodejs server

  • @princezzdaniella3348
    @princezzdaniella3348 3 ปีที่แล้ว

    I just got error bad gateway omg how do u fix that

    • @bobbyiliev_
      @bobbyiliev_  2 ปีที่แล้ว

      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

  • @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.

  • @petergriffin8767
    @petergriffin8767 3 ปีที่แล้ว +1

    very helpful ty

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว

      No problem at all! Happy to hear that this helped!

  • @AmerMaraqa
    @AmerMaraqa 3 ปีที่แล้ว

    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_  2 ปีที่แล้ว +1

      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

  • @awetinodaily7084
    @awetinodaily7084 3 ปีที่แล้ว

    How can i came to this page

    • @bobbyiliev_
      @bobbyiliev_  3 ปีที่แล้ว

      Hi there, You would need to first SSH to the server.

  • @mmusiphuti3261
    @mmusiphuti3261 2 ปีที่แล้ว +1

    very helpfull

  • @UgiloySaidova-pc4wb
    @UgiloySaidova-pc4wb หลายเดือนก่อน

    Ок зур❤

  • @Jankhcr2
    @Jankhcr2 19 วันที่ผ่านมา

    I am on mobile😢

  • @UgiloySaidova-pc4wb
    @UgiloySaidova-pc4wb หลายเดือนก่อน

    Зур❤ ОК

  • @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_  ปีที่แล้ว

      Sorry to hear that, feel free to share more details about your problem and I will be happy to advise you further!

  • @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_  ปีที่แล้ว

      What do you see in your error logs?

  • @AlexyMiro
    @AlexyMiro ปีที่แล้ว

    When i type docker ps -a the container is empty. What can i do about it?