Це відео не доступне.
Перепрошуємо.

How to fix Nginx 502 Bad Gateway Error

Поділитися
Вставка
  • Опубліковано 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

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

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

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

  • @abbasmosumov5907
    @abbasmosumov5907 3 місяці тому +1

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

  • @TradersTradingEdge
    @TradersTradingEdge 3 роки тому +3

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

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

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

  • @subinbabu1121
    @subinbabu1121 3 роки тому +4

    Good work, tony 👍

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

  • @vijaydynamo4050
    @vijaydynamo4050 11 місяців тому

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

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

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

  • @ErikAleksander
    @ErikAleksander Рік тому

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

  • @craftingmate
    @craftingmate 2 роки тому +1

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

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

  • @domarchie9558
    @domarchie9558 2 роки тому

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

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

  • @urmiladevi2237
    @urmiladevi2237 2 роки тому

    it really helped me. thank you very much tony.

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

  • @nabilnuhubamalli1428
    @nabilnuhubamalli1428 Рік тому

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

  • @CreativeCoderMyanmar
    @CreativeCoderMyanmar 3 роки тому

    u saved my life.thanks dude

  • @godwith
    @godwith Рік тому

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

  • @the69thspacemonkey8
    @the69thspacemonkey8 3 роки тому

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

  • @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 ua-cam.com/video/uE4aljoMBeg/v-deo.html

  • @MrThens18
    @MrThens18 2 роки тому

    This was helpful, thank you!

  • @TheDelamode
    @TheDelamode Рік тому +1

    Never been so confused

  • @MaryamChouaibi
    @MaryamChouaibi 2 роки тому

    you're awesome man thank you

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

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

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

  • @martinmtandi335
    @martinmtandi335 2 роки тому +1

    what if you are using a Nodejs backend system

  • @nicholassmith6412
    @nicholassmith6412 2 роки тому

    Thanks - solved the problem 👍

  • @AkmaAit
    @AkmaAit Рік тому

    i dont have server though

  • @jamkat7785
    @jamkat7785 3 роки тому

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

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      If you're on Mac: ua-cam.com/video/SfTSBbaFN8Y/v-deo.html
      If you're on Windows: ua-cam.com/video/pWDHUlvcAsg/v-deo.html

  • @hypeplayzzzzz2441
    @hypeplayzzzzz2441 Рік тому

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

  • @SamuelRojasCarias
    @SamuelRojasCarias Рік тому

    Gracias 🥳Gracias 😁Gracias

  • @ManhNguyen-ix9em
    @ManhNguyen-ix9em 3 роки тому

    Thank you bro.

  • @CrookzArtwork
    @CrookzArtwork 3 роки тому

    Thanks Fam
    You saved my ***ss

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

  • @Nova-Rift
    @Nova-Rift 2 роки тому

    Worked

  • @septicfire6484
    @septicfire6484 2 роки тому

    that’s cool but i’m on mobile

  • @tornado-zex47
    @tornado-zex47 6 місяців тому

    fooling the audiance

  • @bavornwitss1361
    @bavornwitss1361 2 роки тому

    MITSUBISHI GR SERIES