[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedSeptember 7, 2023

How to Install Nginx on Debian 10.

How To Install Nginx On Debian 10.

In this tutorial, we’ll explain how to install and manage Nginx on Debian 10 Buster.

Install Nginx

The Nginx package is included in the default Debian Buster repositories. The installation is pretty straightforward, just run the following commands as root or user with sudo privileges :

sudo apt update
sudo apt install nginx

Nginx service will automatically start after the installation process is complete. You can verify it with curl as shown below:

curl -I XX.XX.XX.XX

You can use the systemctl command to manage the Nginx service , same as any other systemd unit.

Adjust the Firewall

UFW users can open HTTP (80) and HTTPS (443) ports by enabling the ‘Nginx Full’ profile:

sudo ufw allow 'Nginx Full'Copy

If you are using nftables to filter connections to your system, open the necessary ports by issuing the following command:

nft add rule inet filter input tcp dport {80, 443} ct state new,establ

Nginx Configuration File’s Structure and Best Practices

  • Nginx configuration files are stored in the /etc/nginx directory.

  • The main Nginx configuration file is /etc/nginx/nginx.conf.

  • Server block (vhost) configuration files are stored in /etc/nginx/sites-available directory. The configuration files found in this directory are used by Nginx only when linked to the /etc/nginx/sites-enabled directory.

  • To activate a server blocks create a symlink (a pointer) from the configuration file in a sites-available directory to the sites-enabled directory.

  • To write more maintainable code, it’s a good idea to follow a standard naming convention. For example, if your domain name is mydomain.com then the configuration file should be named /etc/nginx/sites-available/mydomain.com.conf.

  • The /etc/nginx/snippets directory contains configuration snippets that can be included in the server block files. If you use repeatable configuration segments then you can refactor those segments into snippets and include the snippet file to the server blocks.

  • Nginx log files (access.log and error.log) are located in the /var/log/nginx/ directory. It is recommended to have a different access and error log files for each server block.

  • You can set your domain document root directory to any location you want. The most common locations for webroot include:

    • /home/<user_name>/<site_name>

    • /var/www/<site_name>

    • /var/www/html/<site_name>

    • /opt/<site_name>

Conclusion

Installing Nginx on Debian 10 is a matter of running a single command.

Now that you have installed Nginx on your Debian 10 Linux you can to start deploying your applications and use Nginx as a web or proxy server.

Keep reading
Understanding the /etc/shadow File
March 6, 2023

Understanding the /etc/shadow File

Understanding The /Etc/Shadow File There are several different authentication schemes that can be used on Linux systems. The most commonly used and standard scheme is to perform authentication against the /etc/passwd and /etc/shadow files. /etc/shadow is a text file that contains information about…

Read article
How to understand ssh and how does it work.
March 5, 2023

How to understand ssh and how does it work.

How To Understand Ssh And How Does It Work. SSH is a protocol for securely exchanging data between two computers over an untrusted network. SSH protects the privacy and integrity of the transferred identities, data, and files. It runs in most computers and in practically every server. It ships…

Read article
How to use AWK command in linux .
March 5, 2023

How to use AWK command in linux .

How To Use AWK Commanda In Linux This article covers the essentials of the awk programming language. Knowing the basics of awk will significantly improve your ability to manipulate text files on the command line. Awk is a general-purpose scripting language designed for advanced text processing. It…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00