title | seoTitle | seoDescription | datePublished | cuid | slug | cover | ogImage | tags |
---|---|---|---|---|---|---|---|---|
DevOps 3.4: Nginx Setup |
DevOps 3.4: Optimizing Web Traffic with Nginx Configuration |
Optimizing Web Service with Nginx Configuration and Deployment. |
Sun Nov 05 2023 22:20:56 GMT+0000 (Coordinated Universal Time) |
clom1eyyj000309l56ygn2p5b |
devops-34-nginx-setup |
linux, nginx, devops, reverse-proxy, wemakedevs |
-
Login to nginx vm:
vagrant ssh web01
-
sudo -i
go to the root user. -
Update OS with the latest patches.
apt update && apt upgrade -y
-
Then install the nginx
apt install nginx -y
-
Create a nginx file:
vi /etc/nginx/sites-available/vproapp
-
Below you can see the initial configuration file which is enabled now -
-
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1699221978595/010c6add-0bda-4519-a354-d80e810e3539.png align="center")
Now remove that link using
rm -rf /etc/nginx/sites-enabled/default
. -
Create a link to activate the website
ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp
-
Then restart the nginx -
systemctl restart nginx