apt-get install nginx
sudo unlink /etc/nginx/sites/enabled/default - This makes it so the default config won't be used anymore
sudo unlink /etc/nginx/sites/enabled/default
cd /etc/nginx/sites-available/
* sites-available is where you put configs that can be used for later
4. sudo nano {name}.conf - This will create the new config file
sudo nano {name}.conf
5. Make config. Config references can be down under the Subsections tab
6. ln -s /etc/nginx/sites-available/{name}.conf /etc/nginx/sites-enabled/{name}.conf - This will enable the Nginx config
ln -s /etc/nginx/sites-available/{name}.conf /etc/nginx/sites-enabled/{name}.conf
nginx -t -c /etc/nginx/{name}.conf - This will test the config file
nginx -t -c /etc/nginx/{name}.conf
systemctl restart nginx - Will restart the Nginx service and enable the config in sites-enabled
systemctl restart nginx
sites-enabled
Last updated 3 years ago