nginx or OpenLiteSpeed? Choosing a web server for your sites
5 min read
Two fast, mature web servers with different habits. What actually differs, which sites suit which, and why the choice is less final than it looks.
When you connect a server to Zefily, one of the first questions is which web server it should run: nginx or OpenLiteSpeed. People tend to treat this as a big, permanent decision. It is neither. Both are fast, both are mature, and in Zefily you can switch a running server from one to the other. Still, they have different habits, and knowing them saves you a few surprises.
In short
- OpenLiteSpeed suits WordPress and PHP apps that rely on
.htaccessrules and the LiteSpeed Cache plugin. - nginx suits mixed servers: Laravel, Node.js and Python apps, containers, reverse proxies and static sites.
- On a well-tuned server both are fast; slow queries, uncached pages and heavy plugins matter far more.
- In Zefily the choice is not final: a running server can switch web servers in place, and switches back by itself if a site stops answering.
The short answer
- Running mostly WordPress, or apps that ship
.htaccessrules (many PHP apps from the Apache world)? OpenLiteSpeed will feel familiar. - Running a mix: Laravel, Node.js or Python apps, containers, reverse proxies, static sites? nginx is the safer default.
If you are unsure, pick nginx. Nothing locks you in.
Where they really differ
Configuration: files vs. .htaccess
nginx reads its configuration from files that only root can change. There is no per-directory override: a rule in an app's .htaccess does nothing. That is a feature (no surprise rules hidden in an uploads folder, no file system lookups on every request), but it means an app's rewrite rules have to be translated once.
OpenLiteSpeed understands Apache-style rewrite rules in .htaccess. WordPress permalinks and most plugin rules simply work. One catch: OpenLiteSpeed reads .htaccess once and keeps it in memory, so a change normally needs a restart. Zefily watches for changed .htaccess files and restarts OpenLiteSpeed gracefully within a minute, so in practice you edit the file and carry on.
How PHP runs
With nginx, every site gets its own PHP-FPM pool, running as the site's own Linux user. With OpenLiteSpeed, Zefily uses LiteSpeed's LSPHP where LiteSpeed builds that PHP version for your system, and the same per-site PHP-FPM for the rest (older versions, or systems LiteSpeed does not build for yet). You pick the PHP version; Zefily picks how it runs. Either way each site is isolated in its own pool.
Caching for WordPress
OpenLiteSpeed's biggest draw is the LiteSpeed Cache plugin for WordPress, which talks to the server's built-in page cache. For a content site with many anonymous visitors, that is a very good deal for very little effort.
nginx has no WordPress-aware cache built in, but a good object cache (Valkey), OPcache tuned for the server's memory and a CDN in front take you a long way. For dynamic apps, where most pages are personal anyway, the difference mostly disappears.
Everything that is not PHP
This is where nginx pulls ahead. Proxying to a Node.js or Python app, WebSockets, containers on a local port, custom headers, rate limits: nginx is the de facto standard, and almost every guide and framework documentation assumes it. Zefily's nginx is our own build with HTTP/3 and Brotli, kept on the mainline releases.
OpenLiteSpeed can proxy too, but its configuration model is built around PHP sites, and you will find fewer examples when you leave the beaten path.
Performance
Benchmarks on either side will tell you the other one is slower. In our experience, on a correctly tuned server both are far faster than what usually limits a site: slow database queries, uncached pages, heavy plugins and large images. Zefily tunes the web server, PHP-FPM, OPcache and the kernel for each server's hardware after installation and whenever a site is added or removed, so you start from a sensible baseline with either choice.
Choose by how your sites are built, not by a benchmark chart.
A quick comparison
| nginx | OpenLiteSpeed | |
|---|---|---|
.htaccess rules |
Not read (rules live in the site config) | Read, Apache-compatible rewrites |
| PHP | PHP-FPM, one pool per site | LSPHP or PHP-FPM, one per site |
| WordPress page cache | Via plugins, object cache, CDN | LiteSpeed Cache plugin with the server's cache |
| Proxies, WebSockets, containers | Excellent, widely documented | Possible, fewer examples |
| Custom directives in Zefily | Yes, with your passkey | Through .htaccess and site rules |
Changing your mind
In Zefily, Switch to OpenLiteSpeed (or Switch to nginx) moves a running server in place: it installs the other web server and its PHP, rewrites every site for it, reuses the certificates already on the server, checks that every site still answers, and only then removes the old one. Sites are unavailable for up to a minute, and if a site stops answering, the server switches back on its own. Because it changes how every site is served, the switch waits for your passkey.
So pick the one that fits today. If your sites change, the server can change with them.
Frequently asked questions
Is OpenLiteSpeed faster than nginx?
Not in a way most sites notice. Both serve static files and PHP very quickly on a tuned server. OpenLiteSpeed's real advantage for WordPress is the LiteSpeed Cache plugin, which uses the server's built-in page cache.
Does nginx read .htaccess files?
No. nginx only reads its own configuration files, so rewrite rules from an app's .htaccess have to be written into the site's configuration once. OpenLiteSpeed reads Apache-style rewrite rules in .htaccess directly.
Which web server is better for WordPress?
Both run WordPress well. OpenLiteSpeed is the easier choice when you want the LiteSpeed Cache plugin and plugins that write .htaccess rules; nginx is a good choice when the same server also runs non-PHP apps.
Can I switch from nginx to OpenLiteSpeed later?
Yes. In Zefily, Switch to OpenLiteSpeed (or Switch to nginx) moves a running server in place, reuses its certificates, checks every site and switches back automatically if a site stops answering. Sites are unavailable for up to a minute and the switch needs your passkey.
Does each site get its own PHP?
Yes. With either web server every site runs as its own Linux user in its own PHP pool, so sites can use different PHP versions and cannot read each other's files.
Read more in the Web stack documentation, or start free with one server.