Author Topic: nginx -> apache -> php-fpm VS nginx -> php-fpm  (Read 4156 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
nginx -> apache -> php-fpm VS nginx -> php-fpm
« on: February 27, 2022, 10:17:32 AM »
I found that CWP have a configuration that is nginx -> apache -> php-fpm what are the advantages of this instead of nginx -> php-fpm?

With nginx -> apache -> php-fpm can we still use .htaccess?

At the moment I'm using Nginx + Varnish + Apache php-cgi, I don't know exactly the impact of Varnish since I don't change any configuration but all websites work well.

Most of the examples on the internet use nginx + php-fpm or apache + php-fpm, I don't understand what are exactly the advantages of have nginx + apache + php-fpm

Offline
*
Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
« Reply #1 on: February 27, 2022, 12:17:11 PM »
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
« Reply #2 on: February 27, 2022, 12:49:31 PM »
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?

Offline
***
Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
« Reply #3 on: February 27, 2022, 09:20:47 PM »
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?

yes and no. Everything will work normally in htaccess except the rules that nginx has been specifically configured to take over. Either way, the best server option is "nginx - varnish - apache - phpfpm"

Offline
*
Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
« Reply #4 on: February 28, 2022, 09:15:38 AM »
using apache allows you to have more flexibility as for nginx all config needs to be done in the nginx vhost conf file,
while apache is more flexible with additional modules and rules like with htacces, PHP custom configuration .user.ini ...and even some scripts will not work well with nginx only.

But with nginx -> apache -> php-fpm all regular htaccess rules will work like in my current config that is Nginx + Apache php-cgi?

yes and no. Everything will work normally in htaccess except the rules that nginx has been specifically configured to take over. Either way, the best server option is "nginx - varnish - apache - phpfpm"

In reallity at the moment in my current server  I have nginx - varnish - apache php-cgi, but I think varnish it not working. After reading a little but varnish seems a little tricky, we need to configure and test it on every website, I will host losts of client websites I don't want to implement anything that required a special configuration for each one.

I'm more interested in have a default configuration like nginx - apache - php-fpm and if I required for some website enable the nginx - varnish - apache - phpfpm
« Last Edit: February 28, 2022, 09:18:30 AM by kandalf »

Offline
***
Re: nginx -> apache -> php-fpm VS nginx -> php-fpm
« Reply #5 on: February 28, 2022, 09:11:32 PM »
Even when selecting nginx - varnish - apache - php on "Select Webserver", Varnish is by default not enabled on domains. Which is good, because like you said, it is tricky.
I have experienced it to be extremely aggressive and will probably conflict with other caching tools.

To enable varnish, re-select the "nginx - varnish - apache - php" on "Webserver Domain Conf" for that specific domain.

Tip: To clear varnish cache for a user instead of the entire server, login to userCP and find the clear cache page.