Перейти к содержанию

Getting Started

The fastest way to install NGINX with modules is using NGINX Extras:

sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm
sudo dnf -y install nginx
sudo systemctl enable --now nginx

Requirements (Source Build)

Library Required For
zlib gzip module
PCRE/PCRE2 rewrite module
OpenSSL SSL/TLS support

Install on your system:

apt install libpcre3-dev zlib1g-dev libssl-dev
dnf install pcre-devel zlib-devel openssl-devel

Installation from Source

Clone from GitHub or download from nginx.org:

# Extract and configure
tar xzf nginx-*.tar.gz
cd nginx-*
./configure

# Build and install
make
sudo make install

By default, NGINX installs to /usr/local/nginx. See installation options for customization.


Running NGINX

Start

sudo /usr/local/nginx/sbin/nginx

Reload Configuration

sudo nginx -s reload

Or using signals:

kill -HUP $(cat /usr/local/nginx/logs/nginx.pid)

PID File Location

The default location is /usr/local/nginx/logs/nginx.pid. On Ubuntu, it's /var/run/nginx.pid.


Platform-Specific Notes

  • Windows: NGINX for Windows (32-bit)
  • Solaris: x86/64 builds available
  • macOS: Install via Homebrew: brew install nginx
  • Linux: Most distributions have packages in their repositories

Next Steps

Topic Description
Command-line options Process signals and CLI usage
Debugging Debug builds and troubleshooting
Optimizations Performance tuning
Pitfalls Common mistakes to avoid