NGINX

All websites in the UTN infrastructure are hosted using NGINX, an efficient web server capable of hosting multiple websites and offering a wide range of server needs.

Most UTN deployments are conducted using Ansible, and the NGINX configurations for those applications are located within the Ansible repository.

NGINX configurations for the hosted websites are stored on the server in the /etc/nginx/sites-available directory. Typically, each configuration file is named after the website (FQDN) it serves. To activate a website, create a symlink from the configuration file to /etc/nginx/sites-enabled. For example: ln -s /etc/nginx/sites-available/test.utn.se /etc/nginx/sites-enabled/test.utn.se.

Useful Commands #

Here are some important commands to use when working with NGINX:

  • nginx -t: Tests the NGINX configuration files for correctness, preventing downtime or blank pages for users.
  • systemctl reload nginx: Applies changes by reloading the NGINX configurations without restarting the service.
  • systemctl restart nginx: Fully restarts the NGINX service, applying changes and restarting all worker processes.

You must execute these commands with root user privileges.

Further Reading #

For additional information and tutorials on configuring NGINX, consider the following resource: