Это видео недоступно.
Сожалеем об этом.

How to fix Nginx 502 Bad Gateway Error

Поделиться
HTML-код
  • Опубликовано: 23 мар 2021
  • Learn how to fix the 502 Bad Gateway error in Nginx by making sure the upstream server and/or reverse proxy server is configured correctly.
    Find more at tonyteaches.tech
    Check out my vlog channel ‪@TonyFlorida‬
    #nginx #502badgateway

Комментарии • 74

  • @ArionGnotta
    @ArionGnotta Год назад +10

    Another reason you may be getting a 502 error is if you are trying to create a container that can be managed by Nginx Proxy Manager but you forgot to add that container to the same network as Nginx Proxy Manager. Once you add the container to the same network it will work. By default, a container will not be auto-assigned to a different specific network, just the default network for that container, so you have to do that manually.

    • @thebaldfox
      @thebaldfox Год назад +2

      You hit the nail on the head. Not once in all these tutorials does it mention needing to join containers!

  • @syedanas4186
    @syedanas4186 Год назад +3

    Thanks man, I am doing server deployment course and I faced this error after Nginx setup and your video solved my error.

  • @micgent
    @micgent 2 месяца назад

    Thank you for the support, I tried 4 webpage only tutorials to get LAMP stack running all failed with little further support which taught me very little. i then tried your LEMP video and webpage combination of tutorial, this resulted in the Bad gateway issue which brought me here. And yes my solution was to modify the wordpress.conf by changing the 2nd line 'server unix:/var/run/php/php7.3-fpm.sock;' to update from 7.3 to 8.2. After a reboot I get the wordpress admin setup. Great tutorial, I leaned a bit more and my command line confidence increased.

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

    Excellent, I had that problem due to two situations. 1 php-fpm was not started and 2 the version of php was not the one I had. Thank you for giving me light.

  • @cooltube7057
    @cooltube7057 2 года назад +2

    Steps mentioned in this video resolved my issue. Thank You so much.🙂

  • @bruccooful
    @bruccooful Год назад +2

    For me it was an outdated instruction set where the path for PHP wasn't correct with the updated version that was downloaded for my distro. Your message about fastcgi_pass at 1:30 was what fixed my issue. Thank you!

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

    Sad to write that this didn't work for me. I had to install php-fpm and once done it installed version 7.4 which is the same version in the default file. At the time you made this video the route was /run/php/version.sock now is in /var/run/php/version.sock even though the file is created in both directories. When I stopped the service I was still able to see the default nginx page. I reconfigured my site .conf file following your video deploying django app and still I get 502 error. This happens after an sftp deployment from github and a restart of the emperor file.

  • @subinbabu1121
    @subinbabu1121 3 года назад +4

    Good work, tony 👍

  • @TradersTradingEdge
    @TradersTradingEdge 3 года назад +3

    Had exactly that problem, which you solved for me :) Thanks Tony!

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

    Hi Tony! Thanks for the video. I was hoping to get more idea bout the terminal stuff that you put some code in the terminal, like how can I get that one or should I manually type everything. Thank you Tony, hoping for the response.

  • @danielarias3156
    @danielarias3156 8 месяцев назад

    Database disconnected for a reason, causing the server to crash each time I launched it, haven't found yet the reason of the disconnection, but that was the reason of the 502, I had to run the server in dev mode in the server to identify the source of the crash

  • @vijaydynamo4050
    @vijaydynamo4050 10 месяцев назад

    I am running an application in nginx and php 8.2..its running fine but often i am getting 502 bad gateway error what can i do??

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

    Thanks for the help, had to change php8.0 to 8.1.

  • @abbasmosumov5907
    @abbasmosumov5907 3 месяца назад

    0:29 How did you get into this program? Where is it?

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

    service php command not working. it says "php: unrecognized service"

  • @Timmahh.
    @Timmahh. 2 года назад +1

    Php come with the nginx install or what? Looks like it was never on my server to begin with. Then why did my sites login page and https redirect work temporarily ? Makes absolutely no sense.

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

      Nginx doesn't come with PHP, you'll have to install that separately.

  • @domarchie9558
    @domarchie9558 2 года назад

    how do you get the box up. don assume everyone knows

  • @urmiladevi2237
    @urmiladevi2237 2 года назад

    it really helped me. thank you very much tony.

  • @AceBoy2099
    @AceBoy2099 2 года назад

    I have this too but see no mention of this 7.x thing in unraid/appdata/swag/nginx/site-confs/default and no clue how to try and manually start that if it's even on my unraid.

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

    I just had to reset my nginx after I made the update to my port and it fixed it. THANK YOU!!!!!!!

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

    How to fix NPM 502 Bad Gateway openresty ? Can you make a new video about it?

  • @stepankovacic2658
    @stepankovacic2658 2 года назад

    Hi. When I wrote vim /etc/nginx/sites-available/default I was told that "vim" is unknown command. What should I do? I also had to "sudo nano default" because I had no file default.

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад

      Instead of vim you can use nano. Might be easier for you. Otherwise you can install vim with apt install vim. Here's a video on how to use vim ruclips.net/video/uE4aljoMBeg/видео.html

  • @petrch1657
    @petrch1657 2 года назад

    The author immediately began to solve the problem without analysis. This is a quick way and not the fact that it can help solve your problem.
    At the very least, I expected to see nginx logging.

  • @prabhupadswain7638
    @prabhupadswain7638 2 года назад

    Hi,
    I am having a problem HTTP 500 error. This came after installing phpmyadmin. I am following your content recently. You are making nice contents.

  • @variancewithin
    @variancewithin 5 месяцев назад

    it took some searching, and they changed this file up A LOT. it looks hella different nowadays (2024)
    you're gonna want to look in
    /etc/nginx/nginx.conf.default
    also if you dont see it, apt install bash-complete so you dont have to type as much
    i have not yet had luck finding the php directory or folder
    if you dont know what he's talking about, typically people run servers in docker containers, and linux is the best way to run a docker container. a docker container is basically a stripped down mini-OS and so all these things you dont understand are pretty easy-ish once you start to get the hang of linux / docker / ssh / bash etc

  • @liva236muzika
    @liva236muzika 2 года назад

    Is PHP-FPM absolutely necessary? What if I am running a .NET site behind nginx, do I need PHP-FPM?

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

      I don't think so. I don't have much experience with .NET

  • @aliraza-yj5tv
    @aliraza-yj5tv 2 года назад

    Hello tony please make a video about nginx 404 not found nginx/1.18.0 (ubuntu)
    I am getting this error on my server

  • @TheDelamode
    @TheDelamode Год назад +1

    Never been so confused

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

    u saved my life.thanks dude

  • @MrThens18
    @MrThens18 2 года назад

    This was helpful, thank you!

  • @MaryamChouaibi
    @MaryamChouaibi 2 года назад

    you're awesome man thank you

  • @nicholassmith6412
    @nicholassmith6412 2 года назад

    Thanks - solved the problem 👍

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

    what if you are using a Nodejs backend system

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

    hello i follow tis steps and still not able to resolve mine

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

    Gracias 🥳Gracias 😁Gracias

  • @ManhNguyen-ix9em
    @ManhNguyen-ix9em 3 года назад

    Thank you bro.

  • @jamkat7785
    @jamkat7785 2 года назад

    But... HOW do you log into the nginx webserver via SSH?

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад

      If you're on Mac: ruclips.net/video/SfTSBbaFN8Y/видео.html
      If you're on Windows: ruclips.net/video/pWDHUlvcAsg/видео.html

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

    Thanks Fam
    You saved my ***ss

  • @Nova-Rift
    @Nova-Rift 2 года назад

    Worked

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

    i- i have no idea what you said uh i dont even know what that menu thing is

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

    i dont have server though

  • @Ali.iiiix7
    @Ali.iiiix7 2 года назад

    I get this error in my game how do i fix it 😭

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад

      The website admin for the game would have to fix that

  • @tornado-zex47
    @tornado-zex47 6 месяцев назад

    fooling the audiance

  • @bavornwitss1361
    @bavornwitss1361 2 года назад

    MITSUBISHI GR SERIES

  • @septicfire6484
    @septicfire6484 2 года назад

    that’s cool but i’m on mobile