How to fix Nginx 502 Bad Gateway Error

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

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

  • @syedanas4186
    @syedanas4186 ปีที่แล้ว +6

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

  • @ArionGnotta
    @ArionGnotta 2 ปีที่แล้ว +11

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

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

  • @micgent
    @micgent 4 หลายเดือนก่อน

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

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

  • @subinbabu1121
    @subinbabu1121 3 ปีที่แล้ว +4

    Good work, tony 👍

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

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

      Sorry these tips didn’t work for you

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

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

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

    it really helped me. thank you very much tony.

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

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

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

    you're awesome man thank you

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

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

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

    u saved my life.thanks dude

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

    This was helpful, thank you!

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

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

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

    Thanks - solved the problem 👍

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

    Never been so confused

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

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

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

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

  • @danielarias3156
    @danielarias3156 10 หลายเดือนก่อน

    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

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

    Gracias 🥳Gracias 😁Gracias

  • @ManhNguyen-ix9em
    @ManhNguyen-ix9em 3 ปีที่แล้ว

    Thank you bro.

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

  • @Timmahh.
    @Timmahh. 3 ปีที่แล้ว +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  3 ปีที่แล้ว +1

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

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

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

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

  • @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 th-cam.com/video/uE4aljoMBeg/w-d-xo.html

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

    Thanks Fam
    You saved my ***ss

  • @abbasmosumov5907
    @abbasmosumov5907 5 หลายเดือนก่อน +1

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

    • @DipanjanDas-uf8pc
      @DipanjanDas-uf8pc หลายเดือนก่อน

      He's using a macbook/apple and it's the terminal screen

  • @Nova-Rift
    @Nova-Rift 2 ปีที่แล้ว

    Worked

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

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

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

    what if you are using a Nodejs backend system

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

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

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

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

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

      If you're on Mac: th-cam.com/video/SfTSBbaFN8Y/w-d-xo.html
      If you're on Windows: th-cam.com/video/pWDHUlvcAsg/w-d-xo.html

  • @variancewithin
    @variancewithin 7 หลายเดือนก่อน

    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

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

    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

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

    that’s cool but i’m on mobile

  • @tornado-zex47
    @tornado-zex47 8 หลายเดือนก่อน

    fooling the audiance

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

    MITSUBISHI GR SERIES

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