improved the nginx section

This commit is contained in:
2026-05-31 00:16:17 +05:00
parent 3ce62f13e2
commit 658a95877c

View File

@@ -9,13 +9,15 @@ Before process any command think about **what it does** and whether the **paths*
You can copy an example of the server file from here: `/examples/nginx/pechatalka.conf`<br> You can copy an example of the server file from here: `/examples/nginx/pechatalka.conf`<br>
<small><i>I prefer to rename nginx config files to domain names. For example: `pechatalka.kodorvan.tech`</i></small><br> <small><i>I prefer to rename nginx config files to domain names. For example: `pechatalka.kodorvan.tech`</i></small><br>
1. `cd examples/nginx`<br> <i>The file will be half commented out specifically to start the server for generating the TLS/SSL certificate</i><br>
1. `cd /examples/nginx`<br>
2. `sudo cp pechatalka.conf /etc/nginx/sites-avaiable/pechatalka.conf`<br> 2. `sudo cp pechatalka.conf /etc/nginx/sites-avaiable/pechatalka.conf`<br>
3. `sudo nvim /etc/nginx/sites-avaiable/pechatalka.conf`<br> 3. `sudo nvim /etc/nginx/sites-avaiable/pechatalka.conf`<br>
<small>3.1 <i>Customize the file according to your requirements</i></small><br> <small>3.1 <i>Customize the file according to your requirements</i></small><br>
4. `sudo ln -s /etc/nginx/sites-avaiable/pechatalka.conf /etc/nginx/sites-enabled/pechatalka.conf`<br> 4. `sudo ln -s /etc/nginx/sites-avaiable/pechatalka.conf /etc/nginx/sites-enabled/pechatalka.conf`<br>
5. `sudo nginx -t`<br> 5. `sudo nginx -t`<br>
<small>5.1 <i>Make sure that <b>NGINX does not throw errors</b>, otherwise proceed to step №3 or to the instructions for generate a TLS/SSL certificate</i></small><br> <small>5.1 <i>Make sure that <b>NGINX does not throw errors</b>, otherwise proceed to the instructions for generate a TLS/SSL certificate</i></small><br>
6. `sudo service nginx restart`<br> 6. `sudo service nginx restart`<br>
### Add mime-type recognition for javascript modules ### Add mime-type recognition for javascript modules
@@ -26,7 +28,11 @@ You can copy an example of the server file from here: `/examples/nginx/pechatalk
### Generate a TLS/SSL sertificate (via [certbot](http://certbot.eff.org/) for [ubuntu](https://ubuntu.com/)) ### Generate a TLS/SSL sertificate (via [certbot](http://certbot.eff.org/) for [ubuntu](https://ubuntu.com/))
1. `sudo apt install certbot python3-certbot-nginx`<br> 1. `sudo apt install certbot python3-certbot-nginx`<br>
2. `sudo certbot certonly --nginx`<br> 2. `sudo certbot certonly --nginx`<br>
<small><i>The **domain** must already be **bound** to the **IP-address** of the server by `CNAME`, `A` or `AAAA` record</i></small> <small><i>The **domain** must already be **bound** to the **IP-address** of the server by `CNAME`, `A` or `AAAA` record</i></small><br>
3. Uncomment and reconfigure the nginx server file
4. `sudo nginx -t`<br>
<small>4.1 <i>Make sure that <b>NGINX does not throw errors</b></i></small><br>
5. `sudo service nginx restart`
### Set up firewall rules for HTTP and HTTPS requests (for [ubuntu](https://ubuntu.com/)) ### Set up firewall rules for HTTP and HTTPS requests (for [ubuntu](https://ubuntu.com/))
1. `sudo ufw allow "NGINX Full"`<br> 1. `sudo ufw allow "NGINX Full"`<br>