nginx

nginx – notes

Reading Time: < 1 minute

nginx is an open source reverse proxy that can be used to solve a number of issues.

Typically one would use this when presenting one public ip and you want to either filter or redirect this traffic to another processor; weather that be on the same machine or yet a different machine. The reverse proxy can even be used to redirect ports so that what comes in as port 80 can be redirected to a different port.

This could also be convenient if for example you were using multiple x each with their own ip.

quick notes:

INSTALLATION:

To get the signing key for the APT repository.

wget http://nginx.org/keys/nginx_signing.key

To add the key to for the package.

apt-key add nginx_signing.key

As a quick edit to add a new source for the repository.

nano /etc/apt/sources.list.d/nginx.list

Note in this instance the config reads hirsute to designate the version of Ubuntu being used. You would need to alter the list add according

deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu hirsute nginx

Now you can simply to update the local apt repository indexes and then finally to install nginx

sudo apt update
sudo apt install nginx

NOTES:

The following code can be used to check the syntax of the nginx config files.

nginx -t

The following command can be used to reload nginx configuration.

nginx -s reload