No beating around the bush, straight to the point, easy examples, and answering questions in the comments. You sir are amazing
@hostinggeek5 ай бұрын
This is by far the best nginx proxy tutorial I've seen in many years of doing this. It should be the standard.
@brendang86104 жыл бұрын
I have been stuck for so long trying to configure the server blocks for my docker droplet. For a beginner like me who until today hadn't even heard of a server block, this was so much more informative than the digital ocean documentation on setting up nginx!!
@bobbyiliev_4 жыл бұрын
Hey Brendan, no problem at all! Happy to hear that you've found this helpful!
@votem21059 күн бұрын
Even now this is a bangger of a tutorial. 10/10 would recommend. You saved me multiple days of studying.
@josephjwilk Жыл бұрын
Thank you so much for this. I have struggled with this, and with some tweaks to the firewall and certbot, it's finally working! Thank you again for the straightforward and uncomplicated directions.
@dayumnson97694 жыл бұрын
Instantly subscribed, what a clear ans straigth forward tutroial. Thanks man!
@bobbyiliev_4 жыл бұрын
Thanks a lot! Appreciate that! 🙌
@tsivanathan4 жыл бұрын
Simple and straight to the point, thanks a lot sir!!!!
@bobbyiliev_4 жыл бұрын
Thank you for the nice feedback!
@mamirazmi Жыл бұрын
Sorry i quite new to docker deployment, can i know how to make it ssl and https with 443
@shadyjeff12 Жыл бұрын
Can you make a tutorial on how to apple letsencypt certificates to those domains?
@soufianeodf91253 жыл бұрын
how you can add ssl certificate for those subdomains ?
@bobbyiliev_2 жыл бұрын
You can do that with a free Let's Encrypt SSL and certbot: www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04
@adremides4 жыл бұрын
Why not run the reverse proxy on a container too?
@bobbyiliev_4 жыл бұрын
That is a good point! Thanks!
@PabloBecerra Жыл бұрын
Nice tutorial! Thank you! I was wondering if it's possible to do the same, but with php-fpm containers. Which would be the right configuration for nginx in this case?
@MarlonSena Жыл бұрын
Tks, Bobby! :)
@brandonb79792 жыл бұрын
Did you edit the default file any? Also subscribed, great video!
@bobbyiliev_2 жыл бұрын
Thank you! No, I just used the default Nginx config, but I had my subdomains pre configured to point to my server before the video
@zeerar2 жыл бұрын
Best tutotrial
@bobbyiliev_2 жыл бұрын
Thank you!
@jimmyj.67924 жыл бұрын
Hi thanks for video but how to automate the creation of subdomain when creating a new docker image with port ? It’s a little bit sad to create manually this file for each feature that i want to deploy. Thanks for your answer 😀
@bobbyiliev_4 жыл бұрын
Hi, yes that is a good point! You could try using Docker Compose, or an automation tool like Ansible to automate the manual tasks.
@jimmyj.67924 жыл бұрын
Bobby Iliev how can i integrate it into a pipeline like Jenkins or gitlab ci ?
@bobbyiliev_4 жыл бұрын
@@jimmyj.6792 I would recommend going through this tutorial here: www.digitalocean.com/community/tutorials/how-to-set-up-continuous-integration-pipelines-in-jenkins-on-ubuntu-16-04
@தியான்4 жыл бұрын
Hi ,can you post cluster management on Docker container like 1 load balancing 2 reachable 3 not reachable ,how do health check
@bobbyiliev_4 жыл бұрын
That is a good idea! I will put it in my todo list and might give it a try!
@GkmVlogs2019 Жыл бұрын
How to access container without changing end point url... for example I have an web api. I will run my web api as 2 container like instance..I want to access.
@shanahjrsuping73444 жыл бұрын
Did you also create A records for these domains?
@bobbyiliev_4 жыл бұрын
Hi Shanah, Yes I had the DNS records all pre-configured.
@shanahjrsuping73444 жыл бұрын
@@bobbyiliev_ Thank you very much!
@bobbyiliev_4 жыл бұрын
@@shanahjrsuping7344 No problem at all! Happy to help.
@vinodhreddy62274 жыл бұрын
I have a issue... I have three Ubuntu servers and I have 12 microservices. One server I created 4 services. One server one compose I configured four services.. I run I'm able register eureka all servixes... Zull gateway I can able to access fst servers but remaining I'm not able to access based on serviceId... Can I tell me where I done mistake
@bobbyiliev_3 жыл бұрын
Hello, If you run docker network inspect do you see all services inside that network?
@jhoanmartinezsilva2609 Жыл бұрын
Are the domains registered? The nane of the file must be the same as the domain? Thanks a lot!
@FrankoMtz Жыл бұрын
Hi, nginx its instaled on your "server" ? or its like an other container?, thanks for the tuto
@ThisIsmeIrving4 жыл бұрын
does this works even if I'm using like 3 docker containers to run a single app with wordpress? I want to use nginx as a load balancer between the containers to run wordpress.
@bobbyiliev_4 жыл бұрын
Yep, this should work with 3 WordPress containers as well. You might have to add some extra proxy rules in the Nginx Server Blocks to make it work for WordPress
@AnanyaDasgupta-t5k5 ай бұрын
I don't have domain name configured for my server. I am trying to achieve the same using public ip. Is that not possible?
@lifetillhope57332 жыл бұрын
what about if i use nginx server as a container. mean my app deploy on one container and i have second container called nginx how i configure my nginx container as a reverse proxy? hope you understand my question. kindly reply
@yongquanrao73982 жыл бұрын
this is really helpful. thanks for sharing.
@bobbyiliev_2 жыл бұрын
Glad it was helpful!
@aloktechie79812 жыл бұрын
Thank you so much for the video. I have my intel NUC setup and i have domain name as well, do we need to also do port forwarding in router or Nginx will take care of it ?
@bobbyiliev_4 ай бұрын
In case that you are just getting started with Docker, I could suggest this free eBook here too: devdojo.com/bobbyiliev/free-introduction-to-docker-ebook
@MohammedAbdulatef4 жыл бұрын
Thank you so much, I have learned a lot from you.
@bobbyiliev_4 жыл бұрын
🙌🏽🙌🏽🙌🏽
@santiagoale6232 Жыл бұрын
This video sir is just perfect, thank you
@juliokavege9772 Жыл бұрын
Nice video that help me so much. But it seen the reverse proxy i configure doesn't work. It doesn't work unless i type the port of my app. My context is : I dockerize a laravel app with 3 services(app, db , webserver(which is nginx)) and it host on hostinger vps.
@adithyakannan233 жыл бұрын
I need the docker to point a domain I have, How to go for that ?
@bobbyiliev_3 жыл бұрын
Hi there, I setup A records for each subdomain name to point to the Droplet's IP address before the video. Here is how you could do that: www.digitalocean.com/docs/networking/dns/how-to/manage-records/
@aswanthbabu12022 жыл бұрын
how did you enable the sub-domian feature can we configure this with out name server and local machine ?
@bobbyiliev_2 жыл бұрын
Hey! For the example I created the DNS records in my DNS zone beforehand, but you could use your hosts file on your local machine if it is just for testing too
@pavelh25184 жыл бұрын
You can also run nginx as a docker container right?
@abhinav.sharma4 жыл бұрын
Yes
@bobbyiliev_4 жыл бұрын
Yes absolutely. It might be even better in some cases.
@jonnetg3 жыл бұрын
Thank you so much!! Excellent Example!
@bobbyiliev_2 жыл бұрын
Thank you! Happy to hear that it was helpful!
@Ashish4474 жыл бұрын
Hi, I ran into an issue while implementing this great solution. Let's say I run the Nginx server as a docker container and it remains up. Now I have a microservices container(dockerized), and is accessed via Nginx reverse proxy. In case when a microservice's container is down for sometime and then restarted, the Nginx throws an upstream error. The upstream error occurs even if the container is up and running. Would appreciate any solution for this issue
@bobbyiliev_4 жыл бұрын
Hi there! This sounds like an interesting setup! Indeed running the Nginx service in a Docker container sounds like a better approach in some cases. In your Nginx configuration, are you using the Docker container IPs for the `server_block`? It sounds like that the docker container IP changes and then the Nginx service is no longer able to connect to the upstream. If this is the case I could suggest 2 things: - Make sure to create a docker network and use the container names rather than the container IPs: www.digitalocean.com/community/questions/how-to-ping-docker-container-from-another-container-by-name - Make sure to specify a restart policy so that if a service crashes, it would be restarted again: www.digitalocean.com/community/questions/how-to-start-docker-containers-automatically-after-a-reboot Finally if none of this helps, I would recommend checking your container logs for some more information on what is wrong: docker logs container_id_here Hope that this helps!
@Ashish4474 жыл бұрын
@@bobbyiliev_ Thanks for your response. I am referring to the containers through their container names. Digging deeper into this issue, looks like an issue not from Nginx. What I observed: I have two containers, one built on Phoenix-elixir, the other built on Flask-uWSGI. This upstream error doesnt occur when I tried stopping and restarting the phoenix container. The issue was specific to the flask container. This certainly seems to be an issue somewhere inside uWSGI. Will get back if i found a solution for this :)
@bobbyiliev_4 жыл бұрын
@@Ashish447 Sounds like a plan! Let me know how it goes!
@Ashish4474 жыл бұрын
@@bobbyiliev_ sure!
@faisalabdi63504 жыл бұрын
i tried to follow this on a Centos vm, when i browse to docker1 url, it keeps taking me to welcome centos url page for somereason, i keep having to add the port number still even though i installed nginx
@bobbyiliev_4 жыл бұрын
Hi, it sounds like that the Nginx server block configuration that you have is not correct. Feel free to post a question on the DigitalOcean community forum and include your current configuration files: www.digitalocean.com/community/questions
@faisalabdi63504 жыл бұрын
@@bobbyiliev_ cool will do.. thanks for your help
@soufianeodf91253 жыл бұрын
Thanks for the video, really helped
@bobbyiliev_3 жыл бұрын
Glad to hear it!
@meghnamishra66594 жыл бұрын
Hey if have two node Js file one for server and another for client who are communicating with same port how to create docker image for DAT?
@bobbyiliev_4 жыл бұрын
Hello, In this case I could suggest following the steps here on how to build a Node.js application with Docker: www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker
@Ombibulous_Bluegrass3 жыл бұрын
Great video, thanks
@bobbyiliev_3 жыл бұрын
No problem at all! Happy to hear that it was helpful!
@kalitsiadischaritos46853 жыл бұрын
Why this way working only with Ubuntu ? I tried also with red hat / centOS, arch , open suse but no results .
@bobbyiliev_3 жыл бұрын
Hi there, The approach is more or less the same, however of course there are some differences between the different Linux distros. For example to install Nginx on CetnOS you would use dnf or yum and not apt. You can follow the steps on how to setup Nginx server blocks on CentOS here: www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7
@kalitsiadischaritos46853 жыл бұрын
@@bobbyiliev_ nope is not that the case. I repeat everything again, all installations done properly. Everything working fine but when it comes to serve the app, only Ubuntu is able to serve it. All other distros serve default ngnix page. Really strange. Anyway could you make one step ahead and add the ssl certificate?
@bobbyiliev_3 жыл бұрын
@@kalitsiadischaritos4685 Feel free to post a question on the DigitalOcean community forum here: www.digitalocean.com/community/questions Make sure to provide as much information as possible including the Nginx server block configuration that you are using.
@FASHIONmanTV12 жыл бұрын
Perfect
@bobbyiliev_2 жыл бұрын
Thanks!
8 ай бұрын
thank you so much for the video, hope this is not a stupid question , is this information in the video valid in 2024 ?
@vietnguyen62283 жыл бұрын
Thank you my friend!
@bobbyiliev_3 жыл бұрын
No problem at all! Happy to hear that this was helpful!
@aravinddas17203 жыл бұрын
Is this method same in the centos environment, if so I'm not getting the URL part could you share the docs I can refer to
@bobbyiliev_3 жыл бұрын
The Nginx configuration should be the same, but the installation process and the location of the config directory is different. You can follow the steps on how to install Nginx on CentOS 7 here: www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7
@aravinddas17203 жыл бұрын
@@bobbyiliev_ Bro, I thank you for writing me back, just cleared all the configuration, wanted to overcome an issue could you look into it error message:- nginx: [emerg] PEM_read_bio_X509_AUX("/root/ssl/rnddev.csr") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE) nginx: configuration file /etc/nginx/nginx.conf test failed
@bobbyiliev_3 жыл бұрын
@@aravinddas1720 it looks like that you've added an SSL certificate to the `/root/ssl` folder, I would recommend moving it to /etc/ssl/ instead and then updating the path in your configuration accordingly.
@aravinddas17203 жыл бұрын
@@bobbyiliev_ Same error brother after moving to /etc/ssl/
@bobbyiliev_3 жыл бұрын
@@aravinddas1720 What is the error that you get when running an Nginx config test with this command: sudo nginx -t
@natural84719 ай бұрын
Thanks ! It's very helpful
@djcaesar91145 ай бұрын
The big problem is that you have to manage the ports, and it will be difficult with multiple projects having their own team.
@salarkamjoo3669 Жыл бұрын
perfect tutorial !
@hanss20062 жыл бұрын
Nice
@bobbyiliev_2 жыл бұрын
Thank you!
@jiazq3 жыл бұрын
'-dit' option mean what? it's wired!
@bobbyiliev_3 жыл бұрын
-d = Detached -i = Keep STDIN open even if not attached -t = Allocate a pseudo-tty
@zeerar2 жыл бұрын
nice
@bobbyiliev_2 жыл бұрын
Thanks!
@CarlosWolfram4 жыл бұрын
Me has cambiado la vida y mi hosting poniéndome limites por crear subdominios xD
@bobbyiliev_4 жыл бұрын
Hi there, there are a few things you could do in this case: * either use actual domain names for each Nginx server block * access the containers directly on the port * use 1 server block with multiple locations, for example, /app1 /app2 and etc Hope that this helps!
@georgez85064 жыл бұрын
Zdravei moje li da me posuvetva6 kak moga pusna wordpress multisite on docker localhost .
@bobbyiliev_3 жыл бұрын
Привет, тук има добър пример за това: github.com/pie-inc/docker-wordpress-multisite
@pdamiano4 жыл бұрын
what about the https ?
@bobbyiliev_4 жыл бұрын
Hi Damiano, you can add SSL with certbot as described here: www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
@தியான்4 жыл бұрын
Nice 👍
@bobbyiliev_4 жыл бұрын
No problem at all! Happy to hear that it helped! 🙌
@ugurserhattoy3 жыл бұрын
Why do you need apache? So isn't nginx enough to do that? Apache + nginx might be sacrificing nginx efficiency... Sounds like running linux on a windows machine.
@bobbyiliev_3 жыл бұрын
The Apache containers were used only for the demo. You of course have to change them with your own application like NodeJS or whatever you are running Inside the container.
@Halissonskalee4 жыл бұрын
Nice! tansks!
@bobbyiliev_4 жыл бұрын
No problem! Thank you for the feedback!
@ibrahimoglu3 жыл бұрын
👍
@bobbyiliev_3 жыл бұрын
🙌
@HafeedElbekkaoui2 жыл бұрын
It's an httpd appache revers server not an Nginx one.
@bobbyiliev_2 жыл бұрын
Not really, it is an Nginx Reverse proxy, in this case the Apache httpd was just the backend service, but it could be anything