Nginx

Install

Macos

Use brew to install

  
    brew install nginx
  

Ubuntu

install

  
    sudo apt update
    sudo apt install nginx
  

Adjusting the Firewall List the application configurations that ufw knows

  
    sudo ufw app list
  

output

  
    Output
    Available applications:
      Nginx Full
      Nginx HTTP
      Nginx HTTPS
      OpenSSH    
  

Enable one out of three profiles.

  
    sudo ufw allow 'Nginx HTTP'  
  

Run:

  
    sudo nginx
  
To check if a port is in use and kill the app, use this command.
  
    sudo lsof -t -i tcp:8080 | xargs kill -9
  

Test:

  
    http://localhost:8080
  

Get configuration file:

  
    sudo nginx -t
  

Stop:

  
    sudo nginx -s stop