How to scale docker containers using Nginx as reverse proxy and load balancer

Поділитися
Вставка
  • Опубліковано 11 січ 2025

КОМЕНТАРІ • 79

  • @teetanrobotics5363
    @teetanrobotics5363 2 роки тому +7

    Please include this in the "Production ready server" playlist. As horizontal auto-scaling is also a very useful feature in the production ready server. Amazing content. Thanks.

  • @suman6327
    @suman6327 2 роки тому +4

    Such crisp & clear explanation. Thanks a lot.

  • @aspirinemaga
    @aspirinemaga Рік тому +2

    Man what a perfect and straight explanation. thank you so much for your efforts! you are a legend

  • @mhavock
    @mhavock 2 роки тому +18

    Still waiting to see the 1000 container version as promised in the thumbnail .... :)

  • @digvijayyamagekar4300
    @digvijayyamagekar4300 2 роки тому +3

    this is some production level content 😂
    thanks man

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

    I couldnt figure it out and you saved me hours of work thanks!!!

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

    Your docker series is awosme .Beacuse u covered almost all tpoics in crash code mode .Thanks

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

    Please accept my gratitude for your content it's definitely helpful ☺️

  • @petroniobonavides3530
    @petroniobonavides3530 5 місяців тому

    Mann.. this lecture is awesome.. thanks. Alottttt

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

    thank you so much. All you guys are brilliant!!

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

    Great content. Do upload similar content so that we as developers can get advanced.

  • @riteshthakur9250
    @riteshthakur9250 3 роки тому +1

    Great tutorial sir as always you make really good tutorials.

  • @medievalogic
    @medievalogic 9 місяців тому +4

    You're not using nginx here to load balance. You're using docker to load balancer. Tge nginx container is just a proxy in this setup.

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

    Simple and quite usefull explanation, thank you.

  • @digvijaysinghthakur2903
    @digvijaysinghthakur2903 3 роки тому +1

    So clear and precise tutorial please make tutorials on kubernetes for beginners also.

  • @mukuljain8383
    @mukuljain8383 3 роки тому +1

    great tutorial, bring more videos on how to work with nodejs and if possible react and aws

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

    Amazing Video :)
    Really helped, just one correction, I believe CI stands for Clean Install. Please correct me if I am wrong.

  • @someonenotlikeyou
    @someonenotlikeyou 6 місяців тому +1

    I have been scratching my head the whole day trying to figure out why my nginx wasn't working. I wasn't using docker-compose.yml; instead, I was creating separate containers for each server instance. On top of that, I was editing the main nginx configuration file (/etc/nginx/nginx.conf) instead of changing the virtual host configuration file (/etc/nginx/conf.d/default.conf) as you did.
    After watching your video, I figured out two issues. First, my containers were not communicating with each other because I hadn't created a custom network for them. After doing that, everything worked fine with reverse proxy and load balancing. Second, I still don't understand what the issue was with using the same upstream to specify the servers and the location with the proxy_pass directive to send them to the servers in round-robin.
    Maybe it's not a good practice to update the main nginx configuration file directly, but I'm not sure. Can you provide me with some resources to read more about nginx configurations? Thanks a lot; this video was a great help! 💕💕

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

    Thank you very much!
    This video helped me a lot.

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

    man thanks for great content

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

    Superb. Thanks for your hardwork.

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

    Well explained. Thank you!

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

    Since there's no upstream definition in the nginx conf, we're pretty much stuck to a round-robin type of configuration with this setup right?

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

    Awesome explanation. Thank you.

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

    Thank you man you are the best

  • @yasser.dev7
    @yasser.dev7 Рік тому

    Pure Gold 🪙, Thank you man!

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

    Wow that was awesome 👌 thank you

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

    Truly a Gem! ✨✨✨

  • @kks2105
    @kks2105 9 місяців тому

    Great explanation, thank you.
    I was just wondering, if we are running in same machine we can use cluster module as well right?
    The nginx with auto-scaling may become prominent when using multiple standalone servers, isn't that right?

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

    In npm ci, ci stands for clean install.

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

    What a nice lesson!

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

    Thank you so much amazing video

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

    awesome. but you didnt say about load balancer!! is it in another video?

  • @10cu7u5
    @10cu7u5 10 місяців тому

    Does this also work with JWT Auth containers? Or will this mess up the JWT auth?

  • @johndoe-g6q
    @johndoe-g6q 2 місяці тому

    Hi, when i tried setting it up.. it only routes between 2 containers instead of all containers (in my case 5). why is it so?

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

    there is a way to create a rule for nginx to fire up more docker containers based on requests demand?

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

    Worker conrainers limited by server thread? Example: server - 4 core 8 thread 4 ram --> I can create only 7 worker container + 1 for nginx
    ?

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

    great content! thanks a lot!

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

    Great video, is it possible to configure de reverse proxy to request server from another machine with different IP? Like configure an upstream cluster in nginx

  • @AbdulAlim-zg8vt
    @AbdulAlim-zg8vt 2 роки тому

    I really liked your command prompt theme. Can you please tell me the theme name?

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

    I am getting error while running docker compose up --scale api-2 - curl localhost:3000 does not round robin between 2 containers alternativly although both containers are created as seen in docker ps. what could be the issue. please help. thank you

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

    Great tutorial, but scaling all those app in the same machine, even with different containers, won`t make so much difference, right?

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

    How can I configure this nginx to add a new distinct service with a different server location, for example /new

  • @StMarc-ow4wz
    @StMarc-ow4wz 2 роки тому

    How we scale up the Nginx container so that there are two replica of Nginx?

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

    may i know what terminal you are using, i am also want suggestion like that

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

      oh-my-zsh + spaceship prompt + autocomplete plugin

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

      @@mafiacodes thanks a lot

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

    Hi ! great video as usual !, is that a normal behavior that you can access the api container by its port without exposing the 3000 port in its Dockerfile?

  • @amansarma417
    @amansarma417 3 роки тому +1

    Sir lets say i have three vps each of dual core processor and each vps will have two docker container running(of same image). How can we load balance and proxy using docker. Since the vps are different they will have different ip and container id how do we link all of them? Do we need to have another vps only for nginx to load balance or just puting nginx in vps1 it will do the job?

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

    what theme are you using?

  • @salishsath530
    @salishsath530 2 місяці тому

    how it will auto scale

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

    good video

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

    Great! Tank you ❤ Hey Bro, I'm scaling a Chatbot where the user's history is preserved. After scaling up I want the users second or forthcoming request to point to the First request Host. I can send the hostname to user and send it back as you shown. Can U guide how to map request to particular host?

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

    thank you. how to scale my MySQL database?
    i am using 1vcpu,2gb ram digital ocean droplet,
    which contains a node js API and MySQL server,
    it works fine, but after 10-12 days MySQL queries become slower.
    how to scale MySQL? i have 50% ram free and only 3-4 % cpu is using most of the time.

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

    can someone give his zsh theme

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

    Can we use this in a production environment??

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

    Bro AWS having less tutorial in UA-cam so working with Aws is too hard for who never know about it can we have tutorial about it

    • @mafiacodes
      @mafiacodes  3 роки тому +1

      I’ll try to make it
      Subscribe like share

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

    Thankyou

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

    Best

  • @BilalShahid-z7y
    @BilalShahid-z7y 3 місяці тому

    wait wait.. npm ci doesnt stand for "continuous integration" it stands for "clean install". make some correction dude.

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

    the only non well explained! part is specifying api on proxy_pass and not saying where its coming from or how nginx detect it cuz its a service name not a loadbalancer upstream name

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

    npm ci = clear & install

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

      Imo continuous integration

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

    I love ❤ you

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

    why u didnt use any orchestration tool? why you made things this complicated??? @yoursTRULY