'Is using 2 webservers (static/dynamic) an overkill to the website?

I use 2 webservers:

  • A dynamic website that servers static content.
  • A static website with content for the first website. Technology: apache2/nginx for example...

Is this overkill? Is this better or worse for the website?



Solution 1:[1]

The mentioned web-servers are both able to serve static and dynamic content (PHP, FastCGI, ..) at the same time.

Why do you want to run two servers if one can do both? With one you will need less memory and you can have virtual hosts for the same port.

Solution 2:[2]

Yah just run nginx and php-fpm, nginx can deliver the static content directly without touching a PHP process (unlike Apache2) so it's much more efficient.

Solution 3:[3]

Companies in general have Apache and that Apache has modules or integrations with systems that are not easy to remove.

It is common to see three layers: NGINX - Apache - Java Server

And every piece serves a different (very important) purpose.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 luukes
Solution 2 Gareth Davies
Solution 3 Raul Lapeira Herrero