When setting up a server to host your website, you may just think it’s best to accept the default web server software (usually Apache) and move on. However, there’s increasing discussion that using Nginx instead can massively improve site speed.
You could think of Apache as the ‘Microsoft Word’ of web servers. It can be a little slow to load, but is packed with features and can do pretty much everything you could possibly need from a web server.
On the other hand, Nginx could be compared to a more basic editor such as Notepad. It’s fast, lightweight, great for writing text and making minor adjustments, but lacks some of the features offered by Word. Whilst this is a weird analogy, it is fairly true.
To go into more detail and compare the features of each, here’s a brief comparison:
Apache Web Server
Advantages:
- Apache is at present the most popular web server.
- Uses .htaccess which is useful for adding redirects.
Disadvantages:
- Slow compared to Nginx.
Nginx Web Server
Advantages:
- Lightening fast. This is due to the fact that Nginx doesn’t need to create a new process for each HTTP request, and can instead make use of multiplexing.
- Uses much less CPU and memory resources.
Disadvantages:
- Not compatible with cPanel yet (Nginx support is on their roadmap).
- No .htaccess file.
- No ‘mod_rewrite’ module.
- Less support options compared to Apache, though the online community is growing.
If you are worried about compatibility issues with the back-end of Apache (for example, losing the .htaccess file and mod_rewrite module), a method often recommended is to keep using Apache for your back-end, then use Nginx for your front-end. If you are using cPanel too, and don’t want to move to Nginx because of this, you can also use this method of combining the two to get the best of both.