Fixing 502 Bad Gateway Nginx

Поделиться
HTML-код
  • Опубликовано: 25 окт 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!

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

  • @paulrodaslema
    @paulrodaslema 2 года назад +1

    Very useful and meaningful content, THANKS!

  • @RajeshShrestha-sc4io
    @RajeshShrestha-sc4io Год назад

    Very Useful. Thank you for the video.

  • @alexgodwin5806
    @alexgodwin5806 3 года назад +1

    Thanks a lot Bobby Iliev

  • @mananvirmani1243
    @mananvirmani1243 3 года назад +1

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

    • @bobbyiliev_
      @bobbyiliev_  3 года назад +1

      Really happy to hear that it was helpful!

  • @jothamsinyanya6954
    @jothamsinyanya6954 3 года назад +1

    Thank you. This was very helpful.

    • @bobbyiliev_
      @bobbyiliev_  3 года назад

      No problem! Happy to hear that it helped!

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

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

  • @rafatahmed1126
    @rafatahmed1126 3 года назад +2

    saved my day thanks

    • @bobbyiliev_
      @bobbyiliev_  3 года назад +1

      Really happy to hear that!

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

  • @AlexyMiro
    @AlexyMiro 11 месяцев назад

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

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

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

  • @petergriffin8767
    @petergriffin8767 3 года назад +1

    very helpful ty

    • @bobbyiliev_
      @bobbyiliev_  3 года назад

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

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

  • @mmusiphuti3261
    @mmusiphuti3261 2 года назад +1

    very helpfull

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

  • @muskangupta1977
    @muskangupta1977 Год назад

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

  • @awetinodaily7084
    @awetinodaily7084 3 года назад

    How can i came to this page

    • @bobbyiliev_
      @bobbyiliev_  3 года назад

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

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

  • @UgiloySaidova-pc4wb
    @UgiloySaidova-pc4wb 28 дней назад

    Ок зур❤

  • @Jankhcr2
    @Jankhcr2 5 дней назад

    I am on mobile😢

  • @UgiloySaidova-pc4wb
    @UgiloySaidova-pc4wb 28 дней назад

    Зур❤ ОК

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