In Depth guide to deploy Fastapi app to AWS ec2 with Nginx, Uvicorn and Supervisor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign welcome to a new video in this video I would like to deploy a fast API application to AWS I have never built a fast API application before so let's build a sample up together and deploy it into AWS [Music] so first API is a python framework to develop apis super fast very popular let's look into the documentation just a bit and let's see if we can create the sample fast API application so let's search here installation so this is the idea so we basically you install fast API as using pip and then yeah either one of these ubicon or hypercon so let's create a sample application uh the sample is already here I have Python 3 already installed Python 3 yeah I have python 3.9 so I need three point version should be enough uh first of all let's create a virtual environment so that the dependencies won't mess with our system python packages so Python 3 minus m v and project so I have a project directory project first API first API so yeah there are some stuff here let's Source this directory Source pin slash activate yeah yeah now you have fast API so let's install peep let's install first API install fast API all right uh python is already talking about availability but let's ignore that for now and let's copy this stuff from the let's copy this stuff from the documentation so let's create a new directory okay there SRC and then code so let's open this directory in Virtual Studio code so you can see that it's already uh so this all these are from our python we end uh a package but really we don't need to worry about much so I have the SRC directory here so maybe if you want to keep a vnp in a different directory this is also possible SRC so let's create main.pi and then paste it here all right so let's um start to run this so some I mean the terminal here already picks up my first API virtual environment and then it says run the server with uvicon main app reload okay so let's install uvicon as well so let's copy this from here pip install the week on standard boom boom boom so we have first API in place and then let's copy the command from here to run to qvcon main app reload all right so it's already picking up stuff so also imagine we are always in the in this directory let's see if there is something going on error loading has could not import module Main I think it's because of uh because our file is inside the SRC directory and then CD SRC and then UV car main app reload this should also work okay so so this this is our API it works in part it runs in Port 8000. and uh yeah so it returns for the root URL it returns a hello world and for items URL it just returns something so let's see items yeah it does return some kind of yeah messages errors yeah we have this API working and in the next video let's see how we can deploy it [Music] all right welcome back now let's look into deploying our application to naws ec27 so I mean the AWS console so also keep in mind that I'm in the Europe Ireland uh region uh just to make sure that whichever region that you are in you keep uh using it or depends on your application if it is something that needs to be served in the US choose a U.S region otherwise whichever is near to you will be faster all right let's spin up an easy to server so in the search type in ec2 virtual service in the cloud let's come inside the instances and create an instance say first APS just give it a name first API demo let me do it demo and then choose a Linux I'm going to choose Ubuntu 22.4 LTS which is the latest one yeah let's let's use this it's also free tier everything is Fleet here we are using free uh yeah a small server and let's create a new SSH pair uh if you would like to know what an SSH pair is yeah just Google it I'm giving it first API demo let's not give it a space yeah let's give it the name first step here demo everything keeping it default pem file create keeper yeah now you have your keypad now you have your pem file downloaded make sure you save it somewhere else you are not going to get it again once you lose it you're going to lose access to your server if you need it again the only option you will have is to destroy the server and create something new we need we need to allow access to our servers okay the new console has these functionalities allows so such traffic so for now let's keep it anywhere or maybe you can keep it you you can select this my IP option to only allow such traffic from your PC for now I'm going to allow it from anywhere uh but yeah you can also choose your IP this is more secure now we need to allow https traffic and HTTP traffic let's allow both and let's continue storage 8GB okay let's let's create a drive to three yeah let's keep it default and then launch an instance all right now let us wait for the instance to be ready yes you can see it as running please click refresh button yeah it just takes a minute or two and yeah let's see it has a public ipv address and yeah uh let's see what the server has to let's see if the server is responding to any internet requests it is it cannot be reached probably because it has nothing inside of the of the of the system now let's try to log into the server from our terminal so it's simple let me clear the terminal let's log into the server for this you need the Pam file which is in our download folder for now I'm going to move it into the project directory foreign yeah so I just copied this spam file here um yeah don't make sure you never commit your pen file in your git repository or anything people can scavenge it and yeah attack your systems but yeah just for the purpose you can see the stuff I'm just copying it here now let's try to connect for this we need the public IP address which is this one or you can even copy uh this you can copy this ipv4 DNS but yeah this this should be more than enough now let's open the terminal let me zoom in a bit so that you can easily see things I'm going to type in SSH minus I look and then you pass in the pen file which is fast API demo.pam and then you type in root at the IP address that you have code that we have copied and it says something yes and yeah it says permission is too open so what we need is to use we need to use a 400 permission you can Google a bit more about the permissions of the certificate we are not going to go deep into the certificate permissions but just um just as the warning message says it is required that the private keys are not accessible by others so we need to use a 400 permission for this you use CH mode 400 first API demo.pam and then issue the command again please log in as the user Ubuntu rather than the user root all right let's let's do it open to yes we are into the server first of all let's replicate our local setup or let's set up a project inside the server which is very simple you can copy with the git clone or any other kind of process let's let's do that quickly all right I just set up this project uh yeah you can see inside our SRC there is the main.pi which is exactly as our source code here and then uh yeah a githick now file and a requirements which lists basically our first API and UV con all these dependencies we do not commit any kind of uh V and virtual and or the actual packages which are listed here and this we will install it in the production server let's go back to the terminal here and let's see what we have already uh which python no python python by the tree there is python 3.10 which is more than enough and let's see if we have git yeah there is also git and uh yeah we should uh we should be good to go now let's uh set up the project inside uh the home directory for now uh let's clone the repository first oh here is first API deployment demo I can leave the link in the description uh you can practice for copying and it's a public repository so yeah let's copy this and let's clone it here yeah and let's see uh it's inside here and let's just rename to fast API because I just don't want to type the full path every time MV first API yeah now we have the first API directory let's go inside let's create a virtual environment first for for that so that our application can run three install minus r requirements txt ah it says P3 not found let's see if there is beep is also not found yeah it says so yeah you can install pip3 with this let's install Pick 3 to uh first of all let's do a server update this is something that we missed Let's do an upgrade all right everything uh is looks like to be on order and let's try to install uh pip again yeah this time it works yes run some processors uh looks like everything is in order now let's create a virtual environment so that our application can install the dependencies in that virtual environment like we did in our local system before python three minus M so we are saying use the module with the m flag which is V and and then pass in the directory name so let me create it in a new directory right now it's called n yeah so it says yeah again we need the vnf package so let's install that sudo yes so V and module is now installed let's try this again all right looks like it has been successfully executed let's see let's find La now you can see this new directory that has got created EnV so that's uh now we just need to activate this ENB Source NV bin activate yeah you can see with the end this is the end we are that we are in and now let's install the dependencies for our application so P3 install minus r one final time wow looks everything got installed now let's try to start our application with the previous command that we were using in our in our local system so let's go back to the documentation to see it once again it says uicon main app reload so let's see UV con Main app free dot could not yeah like it says could not import module let's see SRC Main all right so this works so src.main so this is a syntax that you we can expect so Celsius our directory and inside that the main module or the main dot Pi file and reload so it's running on 8000 uh that means if we go to the public DNS here and then Port 8000 we should be able to see but there are more complications uh in the in the uh in the way because first of all we do not allow for 8000 to be accessed from the AWS Security Group and more than that yeah we don't want our application to be running in Port 8000 in a production server let's say we just want it to be on Port 80. also it's listening to the IP address which is 127 which is of the Local Host that's also not we want what we want we want to run it on the external IP address which is 0.0.0 yeah let's look into these steps one by one right now you can see it's Port running on 8000 and our application cannot reach cannot be reached eight thousand there are two reasons first of all aw Security Group don't allow access to Port 8000 let's fix that first this is the first step let's go to instances here and then you can see the security you can see only Port 80 2010 443 are allowed and this is configured in this Security Group let's go to uh we are inside the security group now and then click on inbound rules and then let's click on this editing bound rules add a new rule for 8 000. and hello from anywhere and save changes now let's try to refresh again you still don't see it what might be the reason it is very simple here you can see uicon is running on 127.0.0.01 and Port 8000 which is not what we want because this is a local host address and what we want to listen to is an external IP address so let's see how we can specify a host actually host 0.0.0.0 yeah 48 000. and let's yeah it's already a responded now you can see in Port 8000 our application is running and already we get a yeah response uh and let's see items slash one yeah you already get some stuff here Q let's pass in Q equal to boom yeah so whatever we pass in the query parameter here it's already responding let me zoom in also to see to make sure that you see it well yeah so right now our application is inside the AWS it's also working it's not a complete solution yet because as long as soon as we close the terminal the application would shut down now you can I clicked on refresh you cannot see uh anything anymore so to have it again you have to start it and then you have to click on reload yeah the application is live again what we want is like a demonized process meaning that we need to run this process in the background uh without any kind of problems and also uvicon in itself is not a great solution to serve your API for this we need something like nginx to handle the incoming request and using nginx you can configure your application to serve like say for example static assets such as fave icons and some CSS files maybe if you are running a full stack application but yeah in the end we made it work in the next video we will see how to make ubicon run in the background using something called process manager foreign [Music] welcome back to the first API deployment to the AWS series until the last video we have made our application running inside an ec2 server with uvcon and the problem was that like whenever we close the terminal we stopped the or we stop the process yeah of course our web server is no more accessible now in this video we are going to take a look into how to make it a persistent process that so that it always runs in the background now there are many ways to achieve this requirement one of it is to use something called a systemd which is a process manager and many other things as well and there are so many process managers available to use one of them is supervisor another one in Circus and yeah some more so what this process managers does is that they always make sure that a number of processes that we say okay say for example I want four uvcon processes to be run all the time so whenever a process goes down this process manager manager will restart it so that yeah we don't have to keep our terminal open all the time it will do it for us and one of my favorite tool is something called supervisor I use it all the time and I'm planning to show it with supervisor in this video and before we go forward let's also take a look into this UV code and now what uvcon is now uvicon is a software that implements the ASCII server python now ASCII stands for asynchronous Server Gateway interface and previously one of the common mechanism was a whiskey server software which is which stands for web server Gateway interface and say for example if you use a Django or those kind of applications you would always see something called whiskey so uvcon is an asgi implementation and gunicon with a G it's a whiskey implementation but this gunicon has more options compared to UV core even though uvicon is somewhat new it doesn't have all the capabilities of gunicon now from the first API documentation you could see that even some of their recommendations include running fast API with a gunicon process manager or interface but instead of doing that let's stick to the UV con instead of introducing tools on top of tools let's stick to what we have already and let's try to make it work with supervisor let's install supervisor you have to issue this command sudo wiser yeah with this you can you should be able to see supervisor CTL yeah you need permissions of course sudo supervisor is running as a root and searching for okay we already have supervisor D now let's create a configuration file for supervisor so that the supervisor can read this configuration file and run our uvcon application and for this uh yeah maybe you can already see that there is no configuration inside this directory now all the supervisor configurations are inside config.d directory before we build up the supervisor configuration let us write a small script to start our application with one simple command so that we don't have to really mangle between the local path and the path in the server whatever command that we write and we just put it in a script that's all so let's come back to our source code here and let me write a new file start protosset so this is as shell script it's nothing complicated so let's begin let's add our shibang line slash bin Bash or bnsh are yeah both works when whenever the script is executing we want to come to the directory where the start.sh file is where the file is present so there is I'm copy pasting something here yeah you you basically get CD into the current directory so let's see this example here if you can I'm just zooming it a little bit here right now I'm in the first API directory so you can see I'm here say for example if I execute start we have to give it executable permission so let's do chmod U plus x dot such so it's nothing complicated so let's come back to terminal you can see I'm in the first API project so let me switch to home directory I want to execute this start script which is inside the project project first step is start.sh execute this you can see this line this comes from this Echo statement here it basically prints out the current directories because we switch to this directory wherever our code is we just got switched to here the paths that we write in the script say for example UV con so uvcon sits inside the EnV directory which is our virtual environment remember I just moved our EnV directory to A New Path here so when I say EnV bin something it will only make sense if we are in the same directory so that's why when the script starts the script basically move the execution to that appropriate directory and then let's see what else and we just have to we just want to activate the virtual environment and we bin activate if you don't do the switch if we don't do the CD what is going to happen is like we will have to type in like slash home slash blah blah blah but the thing is like this script will be different between the server and the local so that's why we have the customization here and then what we want to do is like we want to trigger the uvcon ASCII server uvcon SRC main so or main the pi file is inside the SRC directory you can see here searching main.pi and then call an app we have to do a little bit more configuration here you can see this in the unicorns documentation then host and host equal to 0.0.0 because we want to listen to external connections write in workers now I'm writing it for I'm keeping it four so usually like there is a formula for finding the number of workers that your server can have but yeah for now you can depends on whatever server that you choose you can input this number we need to have this number in in our mind because we need to use it again yeah so this is the simple script so let's see let's try to execute this project first step is start as such yeah you can see application startup complete so yeah accept and now you can see because of the number number of workers four you can see the like four startups and you can see these are like four process IDs this is our start script let me commit it and let's pull it in the server okay all right now it's pushed and then let's go to uh our server which is already here and do a git pull one file changed so let's let's do an LS and then you can see our start.sh is already here now let's try to execute it so we just want to make sure the script is working all right so dot sh yeah it started four one one two three four four processors have been started yeah and it's listening we can also try to reach the website yeah it's here yeah it's already working you can see that uh yeah the server is responding here now we want to run this start script with supervisor for this let's go to the supervisor configuration directory and add a configuration and the configurations are inside the directory called slash HC so let's go there slash HC and then supervisor conf dot d and this is a directory that a supervisor will look into whenever it starts or stops so let's come here Let's do an LS here yeah there are some log files and stuff now let's create our configuration file uh you need of course sudo sudo Touch first API demo.com and then let's edit this file I left the links to this file in the description you can copy it or you can type it along with me first also you need to edit this file so first of all we need to add a title let's add the title which is I'm typing program uvcon yeah it it's just a name supervisor looks into a socket here localhost 8000 which is our port and then command this is the command that we need to run using supervisor which is inside slash home slash Ubuntu slash fast API slash start.sh yeah I just remember this path because it's in our home directory first API and simply start.sh and then we have to add num process I'm prox this should be equivalent to the number of workers that you have specified inside the start script you can see behind here workers equals to four so how many workers we have that many processes we need and then give it a name process name so that you will see it in the logs what is going on or which process is failing stopping starting Etc so first off first step here you'll be gone yeah give it some descriptive name and then you can see process num so this is a parameter so that you will see first Epi unicorn process one process two so it's like just a number and with the D process name and then STD out steady out log file now we want to see the access logs and also the error logs so in case if something goes wrong we can look into the log file and see okay what went wrong with our application because once we close our terminal supervisor is the one keeps who keeps running and in case of any logs the logs files are stored here so you can keep this logs within your application or outside the application or in a temporary location but I like to keep it here or log Super Why sir and then fast API access.log and then I'm copying the same line and then pasting it here and then simply changing it to 3D error whatever is written to the standard error we want to see it in the first API error.log I'm going to uh yeah we need some more config parameters here one is auto start equal to true or tourist start equals to true and then stop as group equals to true signal quit this is a configuration to really kill the process so that we don't have dangling processes that still occupy the port while I was testing it whenever I issue like a restart or something the supervisor process could not really connect to it because the port was being occupied you can actually experiment with some of these options just to I mean to make it work just to make sure that your this path and the port and the number process is correct and also the path here and let's save this and now we have to tell the supervisor to read the configuration and start all the process now let's see if the supervisor main process is running so so those service my search status you can see that the main supervisor service is running and let's see if we can tell the supervisor control to read our new configuration TL re-read wow it says ubicon available you become available tell him to update edit process group and then let's see sudo supervisor CTL status wow you can see according to our pattern that we gave inside the configuration you can see it's created like four processes with four IDs first API UV count one two and three now you can see it's running in the background uh you can also see it's up time so it doesn't stop so it it clearly works let's refresh our website once again well you can see that it works in case if you are stuck somewhere it doesn't give you the right messages gives you some error messages the first thing that you have to look is at the status and in within the status you will be able to see okay if it is failed or running so usually you will see some kind of error messages another place that you will have to look at is the log so let's look at our configuration file once again let's see supervisor comfort.d first API demo.com and you can see that we have given this STD outlog file and STD error log file so in case of any errors you will see it in this file so you can see catch minus n and you can see that it is this is any info messages so let's see if we can make some error and show you the obvious one let's edit our first API slash dot dot sh and we are making some edits to create some errors here restart all let's look into the log file now you can see that it's this error is coming inside the log file even though status shows us running you can see okay it doesn't work because yeah something going on so you can really come to this water slosh hello slash supervisor faster bigger low and then you should be able to see what is going on let's fix the file again as such uh unicorn [Music] C dot main slash app test Dash host workers uh so there is this supervisor CTL restart all command it's all start started and then yeah you should be see your things okay so far we have reached a point where we deployed our application it's working in the background and so your application the API is working one last thing which we have to do now is to put our application behind nginx which is also reverse proxy and the load balancer definitely you can go with uvicon but nginx on the other hand is much more powerful the default settings are much more safe and secure for all of this we have to talk a little bit about the security of our application now if you see all our applications are owned by the user called Ubuntu it's all owned by Ubuntu which is a user which has the pseudo permissions we don't want to run our applications as this user instead we want to run this application as a user with very less privileges we will take a look into the file permissions in the next part of the video and then we will take a look into how to set up nginx [Music] hey everyone welcome back to the series of deploying first API into Cloud so far we have created the application put it in a AWS ec2 instance installed supervisor and configured it to run in the background in this video we are going to tackle a little bit of user management so that our application is a little bit more secure so if you haven't subscribed to my channel yet please subscribe I will be posting more videos like this often let's continue as you can see currently all our files are owned by the user which is called Ubuntu now Ubuntu is a root user now we don't want our files to be owned by or executed by a root user what we want to do is to create or use an existing user one such user which we can use is called www data so to see all the current users in a system you can execute this command cut minus D yeah you can copy it it's this command here cut minus t yeah it's basically lists the lines inside the ETC or HC slash password and there are a lot of users including our user Ubuntu and then register the root and what we are interested in a user called www data most commonly servers like nginx Apache all of them are using this www data user it is nothing particular in just that conventionally web servers are using this user we also uh would like to use I mean it's not I use root user that's the most important part now let us edit the supervisor configuration and change the user so that our star script is being triggered by this triple W data user let's see Slash supervisor control D is first FB the motor you can add the add the configuration here as which user you can run so www data group DW then save this and can use this supervisor CTL update command you will see stopped and updated the process group they read I am not entirely sure what is the difference between these two and let's see the status you can see okay it's already like a fatal uh here let's see uh the error message child could not execute first APA e access so probably looks like a permission error definitely looks like a permission error yeah of course it's it's it's obvious minus La you can see this first API is owned by Ubuntu and of course Ubuntu is a root user and WWE data is not a root user and of course the non-root user cannot execute or anything on the files which are owned by Ubuntu so what we need to do is to issue a command which is called Chon o ch own www data which is the user and WWE data so we are changing the user and the group of the of the project of of all the files recursively from Fast API directory now let's see lessman's La now you can see this first API this this is owned by www data let's go inside first API this means la you can see it's all owned by www now let's restart the supervisor CTL play it let's do an update and the restart all okay there is there is still error of course the first step is this directory is now owned by WWE data but the thing is like this directory sits inside the home directory of Ubuntu which is only accessible to Ubuntu so even though the first API is accessible by WWE data because it is inside the home directory you cannot really access it with the www data user now the solution is that we move this directory to another location which is common uh for almost all the web applications which is inside slash War slash triple W so let's do so CP or MV let's let's do that first API just slash yeah you don't see the file here but slash triple W okay so I just moved it to uh or with four waves so let's see MB into blue www slash fast 8 tape course and K there minus t so so we create this triple W directory all right now let's go inside the triple W directory Alice minus La here you can see that the first API directory is owned by triple W data whereas triple W the folder itself is not owned by triple W data so let us fix it slash War slash so what we are doing is like we are completely owning all the files and directories inside the www folder to this user and with these things should start take place but still we have problem we have to change the start script location of the configuration TD out you can see now it's no more home slash Ubuntu rather War triple W slash type so that should do the trick at least Let's do an update command we are still getting error let's take a look into the logs okay now it says command not found it's line Five Command not found let's look at the start script once again I mean now the permission issues are almost gone cats.sh let's see if it can manually started okay we can command not found e and V so the problem was that when you move the directory you also have to recreate the virtual amp and this is what I'm doing here after some random checks I basically deleted the existing EnV directory and then recreated a new one now activate the EnV of course CSV source and then activate Okay and now and star minus r required txt I am not very confident that we need The Suitor here but like let's see it should install everything and let's see start okay success so this this really starts restart all okay so now that works so basically you have to reinstall the EnV uh yeah virtual end uh that was the idea now let's come here yeah everything works as expected let's try something new yeah it's there them ID 234 yeah so it works it works let's see the status yeah it all works it all works fine all right so that's all about this video uh about changing the user you can see that now our application is completely owned by the user called www data a little bit of changes first of all we change the configurations inside the supervisor configuration and then we move the file to water triple W and change the permissions and then reinstall the virtual amp yeah that's it that's it about the video and in the next video we will see how we can set it up with nginx [Music] thank you hello everyone welcome back to our first API deployment Series this is going to be our last video in the series we are finally going to put our application behind the reverse proxy which is nginx right now you can see our application is running in a port which is in Port 8000 and we want to put it behind uh Port 80 we also want nginx in front of it let's install nginx sudo and install nginx yes let's see if the nginx service have since started so those service nginx status you can see that it's active and running now let's copy the domain here and you should see the welcome to nginx so the default page the famous default page now we want to tell nginx that whatever request comes to you please go and use the fast API to look it up and then serve the user for this we of course need an nginx configuration let's create it as usual all our configurations are inside the slash HC slash nginx directory let's go there CD slash HC slash nginx and then there is sites available and sites enabled so this is the default one and let's let's create one which is inside the site's available folder touch you can see it's all owned by root so let's create this new file attach first API Dot conf of course you need sudo and then let's edit this file API for this we can go to the UV cons deployment documentation and then you on the bottom you can see the running behind nginx so you can see why and like what are the benefits of uh using such a thing so let's copy this stuff here let's not think too much let's copy this thing and I pasted it here and then there are these things server name example.com so you have to replace it with our domain here yeah so you don't need the HTTP or anything any of those stuff so if you have a domain configured of course you can use this domain name here one thing that we have to look for is this proxy pass and you can see it's like HTTP slash uvcon and then you will see this UV con so so whatever is written here is referred here so what I was what we're saying is like pass this as a proxy to here and here it's a server it's Unique and this unique uh it's a unique socket and it's it's basically a file it's a socket it's a file and it's inside the temporary directory so what we have to think about is like this location so when a request comes in our application go is going to look for uh this configuration and from this configuration it sees that it has to go through uvcon here and it's going to look into this it's going to look into this unique socket and then read the informed version from the socket or communicate with the socket and yeah return the response back so let's save this you can see that we have saved our configuration inside sites available directory but this configuration will only be active when this is inside the sites enabled directory to do that we use a technique called Sim link you can also create this file inside the sites enabled directly but it is better to have it inside the sites available and then use a SIM link so you can see LS minus l a sites enabled ah okay so we are inside of this come out you can see that this is a Sim link from the default to so it's available default yeah so let's let's do the same thing so Ln minus s also of course you need sudo so L minus s slash HC engine X sites available slash fast API conf to slash HC slash nginx slash sites enabled so let's see this thing again so you can see okay we have our new configuration present and this for this configuration to take effect we have to restart nginx service engine x free start probably we are going to get some errors of course the socket doesn't exist yet yeah as you can see it's already errored and yeah sites stopped responding to fix it yeah remember the location of the file that we had get enabled it's it's here now in within the uvcon documentation you can see you can see this parameter UDS it's basically Unix domain socket bind to a unique domain socket so let's go to our start script and fix it and our start script now lives inside the war triple W folder you can find it all in the in the repository all these configuration files will be there so don't worry about it uh even if something is missing between this or we are changing it between the videos but you can find it in the in the repository let's go inside the triple w ow first API directory and we I start.sh at this point my recording somehow stopped working but I have modified the start script to just have the parameter UDS because the workers and other parameters were causing some problems you can see the modified file so right now it has only uvicon and the UDS so bind to the unique so main socket with the file descriptor and the workers it was causing problem let's see where does this lead us but right now if I do start.sh you will see this error but behind the scenes supervisor is already running this script and that's why we cannot use the same address and that is the error that pops up here let us check how supervisor is doing so the service supervisor you can see the main supervisor process is running you can see all of this is running all of these are running here but our ngx is also failing right now you can see the service engine X status you can see it is also failing and the configuration test failed yeah so let's see what are the failures on this in this case so the door engine x minus t HTTP directive is not allowed here okay let's see Etsy slash GNX let's sides here you can see this HTTP block that needs to be removed let's see if we move this let us save this now could not okay now the error has changed you should increase the server names hashback it says 64. now we have to edit the main nginx configuration not the custom configuration that we have made for our application yeah we can see the server names hash bucket size 64 this line here and let's increase it into a little bit bigger number say 128 let us save this configuration okay it's okay it's successful everything looks good Linux restart all right wow so guys our application is now being run through nginx we can verify this I'm opening the web developer tools doing a refresh here you can see Server nginx11.8 Ubuntu so right now it's being run through nginx items slash to three yeah so it works obviously everything is good all right so I guess that's it so we finally put it through nginx hopefully we see you in another video so please post your doubts comments if you need help just comment it hopefully I can help you let's see you in another video [Music] [Music]
Info
Channel: Shobi P P
Views: 4,574
Rating: undefined out of 5
Keywords:
Id: E5IhKYT7ecU
Channel Id: undefined
Length: 52min 57sec (3177 seconds)
Published: Thu Feb 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.