Create a Site that serves an app on a specific port

To create a site add a file to the sites enabled folder. Name it the DNS of your site.

server {
    listen 80;
    listen [::]:80;

    location / {

Enable/Disable a site

To enable a site create a symbolic link:

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Then run

sudo service nginx restart

To disable a site simply delete the symbolic link:

rm /etc/nginx/sites-enabled/

Leave a Reply

Your email address will not be published. Required fields are marked *