What is the preferred web server for production environments, nginx or Apache, and why?

Hi everyone,

For those folks out there doing support for hosting companies - what is, as of today, the preferred web server for production environments? Nginx, Apache, or other solution, and why?

Please note that I am not really interested in usage statistics - just the reasons why people use one or the other.

Thanks in advance!

1 Like

It depends on the project. Most hosting companies use Apache as it’s easier to manage in a multiuser environment. Nginx is used on servers, dedicated to a single project as it is lighter and seems to perform faster. Others use both Apache and Nginx (Nginx as a reverse proxy). That way you get the best from both worlds.



Thank you! Although I have used both Apache and nginx (mostly Apache, actually) I am not in the web hosting business so I was curious about this.

You raised an interesting point, which is the fact that both can work together to complement the functionalities of the other.

Indeed, the setup of reverse proxy is not that hard actually, but the person managing them must have a good knowledge of both Apache in Nginx.

By the way @gacanepa I would like to thank you for your articles about the LFCS on tecmint.com. Really enjoyed them and helped me get my certificate. Strangely the LinuxFoundation never had an actual question about web servers, samba, FTP , MySQL/PostgreSQL. I really think those should be part of the things a system administrator should know.

Thank you for your kind words about the LFCS series. I agree with you in that the required domains and competencies for this exam (as well as in the case of LFCE) as outlined by the Linux Foundation are a little vague, but IMHO that gives you the advantage of striving to learn as much as possible, so in the end it’s a good thing. Web servers, FTP, and Samba, are covered in the LFCE exam.
Thank you again for taking the time to reply to this post!