What is Nginx?
Nginx is a web server and reverse proxy that handles many simultaneous connections with low memory and CPU usage. It serves static files (images, CSS, JavaScript) directly, and forwards dynamic requests to an application backend such as PHP-FPM.
Its event-driven design suits high-traffic sites, caching, and routing HTTP/HTTPS requests to the correct backend. It is the most widely deployed web server for modern PHP applications.
On TurboStack
Nginx is the default web server on TurboStack and is recommended for most workloads.
-
Each host runs one web server. When Nginx is selected, TurboStack provisions and manages it for every application on that host.
-
TurboStack generates the per-application virtual host (vhost) for you. The generated config includes sensible caching headers, static-asset expiry rules, security denies (blocking access to sensitive paths), and the correct PHP-FPM backend for each application's PHP version.
-
You do not edit raw Nginx config files. You enable Nginx at the host level and, where needed, adjust per-application behavior through the supported settings - TurboStack renders and reloads the configuration safely.
Note
Nginx and Apache are mutually exclusive on a host - you choose one web server per host. Nginx is the default and the recommended choice unless your application specifically needs Apache features.
Best practices
-
Keep Nginx as your web server unless an app genuinely requires
.htaccessor Apache-only modules. -
Let TurboStack generate the vhost rather than hand-rolling config, so caching, expiry and security rules stay consistent.
-
Serve static assets through Nginx and reserve PHP-FPM for dynamic requests to keep response times low.
-
Pair Nginx with a caching layer (such as Varnish or Redis) for read-heavy, high-traffic sites.
-
Always front Nginx with Transport Layer Security (TLS) - terminate HTTPS at the web server for every public application.