From 5415f37e8da7615b524173f2bb6968be46128d20 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Tue, 8 Jun 2021 00:58:33 -0600 Subject: add 404 pages, edit entries and start skeleton for xmpp server entry --- blog/dst/a/website_with_nginx.html | 49 ++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'blog/dst/a/website_with_nginx.html') diff --git a/blog/dst/a/website_with_nginx.html b/blog/dst/a/website_with_nginx.html index 7e5bd99..caf756f 100644 --- a/blog/dst/a/website_with_nginx.html +++ b/blog/dst/a/website_with_nginx.html @@ -95,14 +95,18 @@

Nginx

+

Nginx is a web (HTTP) server and reverse proxy server.

You have two options: nginx and nginx-mainline. I prefer nginx-mainline because it’s the “up to date” package even though nginx is labeled to be the “stable” version. Install the package and enable/start the service:

pacman -S nginx-mainline
 systemctl enable nginx.service
 systemctl start nginx.service
 
-

And that’s it, at this point you can already look at the default initial page of nginx if you enter the ip of your server in a web browser. You should see something like this:

-

Nginx welcome page

-

As stated in the welcome page, configuration is needed, head to the directory of nginx:

+

And that’s it, at this point you can already look at the default initial page of Nginx if you enter the IP of your server in a web browser. You should see something like this:

+
+Nginx welcome page +
Nginx welcome page
+
+

As stated in the welcome page, configuration is needed, head to the directory of Nginx:

cd /etc/nginx
 

Here you have several files, the important one is nginx.conf, which as its name implies, contains general configuration of the web server. If you peek into the file, you will see that it contains around 120 lines, most of which are commented out and contains the welcome page server block. While you can configure a website in this file, it’s common practice to do it on a separate file (so you can scale really easily if needed for mor websites or sub-domains).

@@ -125,7 +129,7 @@ http { types_hash_max_size 4096; } -

Next, inside the directory /etc/nginx/ create the sites-available and sites-enabled, and go into the sites-available one:

+

Next, inside the directory /etc/nginx/ create the sites-available and sites-enabled directories, and go into the sites-available one:

mkdir sites-available
 mkdir sites-enabled
 cd sites-available
@@ -144,28 +148,32 @@ cd sites-available
     }
 }
 
-

Note several things:

+

That could serve as a template if you intend to add more domains.

+

Note some things: