There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter


Start with a basic install and configuration:

sudo apt update
sudo apt -y install nginx
sudo sed -i 's/# server_tokens off;/server_tokens off;/g' /etc/nginx/nginx.conf
sudo service nginx start

Test that it's working (should see “Welcome to nginx!”)

sudo /bin/rm /etc/nginx/sites-enabled/default
sudo service nginx stop

Most servers don't serve static content and therefore need to add an application engine to produce the content:

After the application engine is setup/configured or an application engine is not needed, I prefer to configure each site with the configuration it needs by putting each web site/application in a separate configuration file named by the URL then enable it, test the configuration. for example:

sudo ln -s /etc/nginx/sites-available/url.domain.tld /etc/nginx/sites-enabled/url.domain.tld
sudo service nginx configtest

Finally, reload the web server configuration:

sudo service nginx reload

Other NGINX Articles

Last Updated: February 7, 2019

Copyright © 2022 by Julian Easterling. SOME RIGHTS RESERVED.
Privacy Policy              Terms of Use             

Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.

All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.