Nginx¶
In this article
Information
Nginx is a high-performance web server and reverse proxy server. This solution provides fast automated deployment of Nginx based on the Ubuntu operating system with SSL/TLS support.
Main Features¶
- High Performance - Efficient handling of a large number of simultaneous connections.
- Fast Deployment - The installation process takes about 5 minutes.
- Integration with Let's Encrypt - Automatic configuration of SSL certificates via Certbot for secure HTTPS connection.
- Modular Architecture - Support for additional modules (GeoIP2, Stream, Mail, Image Filter, XSLT).
- Pre-configured Setup - Pre-installed settings for optimal web server performance.
- Support for Virtual Hosts - Ability to host multiple websites on a single server.
- Reverse Proxying - Use as a load balancer and caching proxy.
Deployment Features¶
| ID | Compatible OS | VM | BM | VGPU | GPU | Min CPU (Cores) | Min RAM (Gb) | Min HDD/SDD (Gb) | Active |
|---|---|---|---|---|---|---|---|---|---|
| 405 | Ubuntu 22.04 | + | + | + | + | 1 | 1 | 20 | ORDER |
- Installation time: about 5 minutes;
- Installation method: automated installation via Ansible;
- Required dependencies:
- apt (package manager);
- systemd;
- Nginx version: 1.18.0-6ubuntu14.7;
- Installed modules:
- nginx-core;
- libnginx-mod-http-geoip2;
- libnginx-mod-stream;
- libnginx-mod-stream-geoip2;
- libnginx-mod-mail;
- libnginx-mod-http-image-filter;
- libnginx-mod-http-xslt-filter;
- python3-certbot-nginx;
- Main installation paths:
- Configuration files:
/etc/nginx/; - Executable file:
/usr/sbin/nginx; - Logs:
/var/log/nginx/; - Web directory:
/var/www/html/; - Systemd service:
/usr/lib/systemd/system/nginx.service;
- Configuration files:
- Integration with Let's Encrypt:
- Certificates:
/etc/letsencrypt/; - Renewal hooks:
/etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh;
- Certificates:
- Automatic log rotation via logrotate:
/etc/logrotate.d/nginx; - Support for UFW firewall:
/etc/ufw/applications.d/nginx.
Note
Unless otherwise specified, by default we install the latest release version of the software from official repositories.
Structure of Installed Components¶
After installation, the following directory and file structure is created in the system:
Configuration Files:
/etc/nginx/
├── nginx.conf # Main configuration file
├── sites-available/ # Available virtual host configurations
│ └── nginx71661.hostkey.in.conf
├── sites-enabled/ # Active virtual hosts
│ └── nginx71661.hostkey.in.conf
├── conf.d/ # Additional configurations
└── modules-enabled/ # Enabled modules
System Files:
/etc/init.d/nginx # Init script
/etc/default/nginx # Environment variables
/etc/systemd/system/multi-user.target.wants/nginx.service
Logs and runtime:
/var/log/nginx/ # Log directory
├── access.log # Access log
└── error.log # Error log
/run/nginx.pid # PID file of the process
Nginx Configuration¶
The main configuration file /etc/nginx/nginx.conf contains the following settings:
Basic Parameters:
- User:
www-data - Worker processes: auto
- Worker connections: 768
HTTP Settings:
- sendfile enabled for optimizing file transfers
- TCP nopush activated
- MIME types supported from
/etc/nginx/mime.types
SSL/TLS:
- Supported protocols: TLSv1, TLSv1.1, TLSv1.2, TLSv1.3
- Server cipher priority enabled
Logging:
- Access log:
/var/log/nginx/access.log - Error log:
/var/log/nginx/error.log
Compression:
- Gzip enabled for traffic optimization
Virtual Hosts:
- Configurations loaded from
/etc/nginx/conf.d/*.conf - Active sites from
/etc/nginx/sites-enabled/*
Important
Always check the syntax with the command nginx -t before restarting the service after modifying Nginx configuration.
Getting Started After Deploying Nginx¶
After purchasing an order, you will receive a notification at the email address registered during signup when the server is ready for use. This notification will include the VPS IP address, as well as login credentials for connection. Our company's clients manage equipment through the server control panel and API — Invapi.
Authentication data, which can be found in the Info >> Tags tab of the server control panel or in the sent email:
- Login:
root; - Password: sent by email to your address upon server readiness after software deployment.
To use the service, connect to the server via SSH:
After Nginx installation completion, it is automatically started and ready for operation. Check the status of the Nginx service: Service Management:Start:
Stop: Restart: Reload configuration:Note
Detailed information on Nginx's basic settings is available in the official documentation.
Ordering Nginx Using API¶
To install this software using the API, follow this instruction.
Some of the content on this page was created or translated using AI.