Note: These instructions are for NGINX-1.25.1 which, at the time of this writing, was the latest version.
Go to that programs
folder you made and do:
wget https://nginx.org/download/nginx-1.25.1.tar.gz
Then extract it:
tar -xzf nginx-1.25.1.tar.gz
Next, cd into the nginx folder and type:
./configure --prefix=/path/to/your/programs/nginx-install --with-pcre=/path/to/your/programs/pcre2-10.42
Remember to replace both of the "/path/to/your/programs
" stuff with the path you copied to your notepad. After that, type the
following commands:
Now we need to change the port of NGINX to a different port since, because we have don't have root access, we can't use port 80.
Note this isn't required if you are installing on your own computer. I change it to port 3200 but you can change it to any other
port number. So, go back to the programs
folder and cd into nginx-install
. Then, do:
Inside it, change this line:
listen 80;
to:
listen 3200;
Now we need to make the sites-available
and sites-enabled
folders for Kibana in the future. So, in that same nginx.conf
file, find:
include mime.types;
below that line, type:
include /path/to/your/programs/nginx-install/sites-enabled/*;
Remember to replace /path/to/your/programs
with the path you copied to your notepad.
Now you're done with the nginx.conf
file. Next, do:
mkdir sites-available
mkdir sites-enabled
Now do:
nano sites-available/file.com
Inside it, add this:
server {
listen 3200;
server_name file.com;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
prxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
If you didn't use port 3200 you need to change that in this file. Now do:
ln -s sites-available/file.com sites-enabled/file.com
Finally we are ready to run NGINX. Run this:
Now you're done installing NGINX.
Let's verify that it runs.
On your computer (not UTD server), run the following command:
Once you type in your password, go to the browser on your computer and go to localhost:3200
. It should show a
"Welcome to nginx!" page. If so, you've installed NGINX successfully.