Nginx vs Apache: which web server should you run?
Nginx and Apache serve the overwhelming majority of the web. They do the same job — receive HTTP requests and return responses — with very different designs. The honest answer is that either can serve almost any site well; they differ in how they behave under load and how you configure them.
The architectural difference
Apache (classic MPM) traditionally uses a process/thread per connection model: each connection gets a worker. This is simple and very compatible, but memory use grows with concurrent connections.
Nginx is event-driven: a few worker processes handle many connections asynchronously. It stays lean under high concurrency and is excellent at serving static files and proxying.
Modern Apache (with the event MPM) narrows the gap, and Nginx can proxy to anything — so the choice is less dramatic than it once was.
Where each one shines
| Nginx | Apache | |
|---|---|---|
| Static files / high concurrency | Excellent, lean | Good |
| Reverse proxy / load balancing | Best-in-class, very common | Capable |
.htaccess per-directory config | No (config is central) | Yes — its signature feature |
| Module ecosystem | Modules compiled in | Huge, dynamically loadable |
| Config style | Declarative, centralised | Per-directory overrides possible |
The decisive question: do you need .htaccess?
If your site or CMS relies on .htaccess files — many WordPress setups and legacy PHP apps ship them — Apache (or Nginx with careful translation) is the path of least resistance. If you want maximum performance and you control the config centrally, Nginx is the common modern default.
In practice, most stacks use both
The most common production pattern is Nginx in front of Apache or PHP-FPM: Nginx handles static files, TLS and high concurrency, and proxies dynamic requests to the application. That gets Nginx's efficiency with Apache's or the app's flexibility.
How to choose
Serving static content, or proxying to an app → Nginx.
Legacy PHP app that depends on
.htaccess→ Apache.Not sure → Nginx as a reverse proxy in front of your app is a safe, high-performance default.
Whichever you run, put TLS in front, enable HTTP/2, and compress responses. Check your live setup with the web server checker, HTTP/2 checker and compression checker. Our web hosting and VPS images come with a sensible default stack already configured.