3 - NGINX

Let us install and configure NGINX

When configuring NGINX for production, you should always turn of information that the server leeks. Do:

Remove the # in front of "server_tokens off;"

Restart NGINX:

Useful commands

  • $ sudo apt-get install nginx
  • $ sudo systemctl status nginx
  • sudo systemctl reload nginx (service is being used in the recording but systemctl is newer and should be used.)
  • /etc/nginx/nginx.conf - Location of global config file
  • /etc/nginx/sites-enabled/default - Location of default server block config file.

Template

The following can act as a template to get applications up and running in the course. Pay extra attention to the / on the first and second line.