Need to migrate your e-mails to a new server? Free and paid versions of our online tool available.
Hero Image

Nginx Web Server

Install Nginx on AlmaLinux 9

Install Nginx on AlmaLinux 9

Step 1 – Update and enable EPEL

dnf update -y
dnf install epel-release -y

Step 2 – Install Nginx

dnf install -y nginx

Step 3 – Enable and start

systemctl enable --now nginx

Step 4 – Firewall

firewall-cmd --permanent --add-service=http
firewall-cmd --perma...
7th May 2026

Install Nginx on RHEL 9

Install Nginx on RHEL 9

Step 1 – Update and enable EPEL

dnf update -y
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms

Step 2 – Install Nginx

dnf install -y nginx

Step 3 – Enable and start

systemctl enable --now nginx

Step 4 – Firewall

firewall-cmd --perm...
7th May 2026

Install Nginx on Ubuntu 24.04

Install Nginx on Ubuntu 24.04

Step 1 – Update packages

apt update && apt upgrade -y

Step 2 – Install Nginx

apt install -y nginx

Step 3 – Enable and start

systemctl enable --now nginx

Step 4 – Firewall

ufw allow 'Nginx Full'
ufw reload

Step 5 – Verify

nginx -v
curl -I http://local...
7th May 2026

Install Nginx on Debian 12

Install Nginx on Debian 12

Step 1 – Update packages

apt update && apt upgrade -y

Step 2 – Install Nginx

apt install -y nginx

Step 3 – Enable and start

systemctl enable --now nginx

Step 4 – Firewall

ufw allow 'Nginx Full'
ufw reload

Step 5 – Verify

nginx -v
curl -I http://localhos...
7th May 2026

Install Nginx on Gentoo Linux

Install Nginx on Gentoo Linux

Step 1 – Sync Portage

emerge --sync

Step 2 – Set USE flags

Create /etc/portage/package.use/nginx:

www-servers/nginx http http-cache http2 pcre ssl

Step 3 – Install

emerge --ask www-servers/nginx

Step 4 – Enable (OpenRC)

rc-update add nginx default
rc...
7th May 2026

Install Nginx on Arch Linux

Install Nginx on Arch Linux

Step 1 – Update

pacman -Syu --noconfirm

Step 2 – Install

pacman -S --noconfirm nginx

Step 3 – Enable and start

systemctl enable --now nginx

Step 4 – Firewall

ufw allow 80/tcp && ufw allow 443/tcp && ufw reload

Step 5 – Verify

nginx -v && curl -I http:/...
7th May 2026

Install Nginx on OpenBSD 7.5

Install Nginx on OpenBSD 7.5

Step 1 – Install

pkg_add nginx

Step 2 – Enable

rcctl enable nginx
rcctl start nginx

Step 3 – PF firewall

Add to /etc/pf.conf:

pass in on egress proto tcp to port { 80 443 }
pfctl -f /etc/pf.conf

Step 4 – Verify

nginx -v
ftp -o - http://localhost

C...

7th May 2026

Install Nginx on NetBSD 10

Install Nginx on NetBSD 10

Step 1 – Update pkgin

pkgin update

Step 2 – Install

pkgin install nginx

Step 3 – Enable at boot

Add to /etc/rc.conf:

nginx=YES
/etc/rc.d/nginx start

Step 4 – NPF firewall

Add to /etc/npf.conf:

pass in final proto tcp to any port 80
pass in final p...
7th May 2026

Enable TLS/SSL on Nginx – RHEL 9

Enable TLS/SSL on Nginx – RHEL 9

Step 1 – Self-signed certificate (testing)

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
    -keyout /etc/ssl/private/nginx-selfsigned.key \
    -out /etc/ssl/certs/nginx-selfsigned.crt \
    -subj "/CN=example.com"
openssl dhparam -out /etc/ssl/certs/dhp...
7th May 2026

Enable TLS/SSL on Nginx – Arch Linux

Enable TLS/SSL on Nginx – Arch Linux

Step 1 – Self-signed certificate (testing)

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
    -keyout /etc/ssl/private/nginx-selfsigned.key \
    -out /etc/ssl/certs/nginx-selfsigned.crt \
    -subj "/CN=example.com"
openssl dhparam -out /etc/ssl/certs...
7th May 2026

Nginx Rate Limiting on RHEL 9

Nginx Rate Limiting on RHEL 9

Define zones in http block

http {
    limit_req_zone $binary_remote_addr zone=api:10m     rate=10r/s;
    limit_req_zone $binary_remote_addr zone=login:10m   rate=5r/m;
}

Apply to locations

location /api/ {
    limit_req zone=api burst=20 nodelay;
    limit_re...
7th May 2026

Nginx Rate Limiting on Arch Linux

Nginx Rate Limiting on Arch Linux

Define zones in http block

http {
    limit_req_zone $binary_remote_addr zone=api:10m     rate=10r/s;
    limit_req_zone $binary_remote_addr zone=login:10m   rate=5r/m;
}

Apply to locations

location /api/ {
    limit_req zone=api burst=20 nodelay;
    limi...
7th May 2026

Nginx Load Balancing on RHEL 9

Nginx Load Balancing on RHEL 9

Round-robin (default)

upstream myapp {
    server 192.168.1.10:8080;
    server 192.168.1.11:8080;
    server 192.168.1.12:8080;
}
server {
    listen 80;
    server_name lb.example.com;
    location / { proxy_pass http://myapp; }
}

Least connections

upstream m...
7th May 2026