NGINX Proxy (Caching) + Apache Backend

Running HCP 1.2.0 on Ubuntu 18.0.4… I’m experiencing some website performance issues where page are extremely slow to load or end up generating page 504 errors. After some t-shoot this problem I’ve tried to disable the nginx proxy via GUI but this disable don’t seem to have an effect. I had to manually disable/stop nginx from cli and also modify the vhost settings for nignx not to listen on port 80 and change apache to listen on port 80. After doing this the site performance seems to work well.

So, my question/comments:

  • Should the disable of nginx via GUI work properlly to stop nginx from listening on port 80 and then have the apache backend vhost then serve site via port 80.
  • I don’t think some of the nginx resource performance options MATCH well with apache php.ini resource parameters properly.

Has any one experience this kind of website performance issues with nginx proxy + apache. Also, mysql settings is one I’m wondering about. Any comments feedback appreciated!

  • What template are you using?
  • Mod php or PHP FPM?
  • Apache in event or prefork mode?

With Nginx (Proxy mode with + Apache2 I was able to disable to switch of any caching plugins (Wordpress) without any loss of performance )


disabling ‘proxy’ in the panel here even means, that there will be no serving of static files via nginx only. instead nginx passes everything on to apache2 directly - which technically is still or even more ‘proxying’.
but yeah. people have a different expectation of what that ‘proxy’ does and how it speeds up their pages :wink: that’s how it worked it’s way into the panel with that naming…

as you can only have one service on the server listening to port 80 you simply could not mix proxy and “no”-proxy options for different websites on the same server otherwise.

for page speed optimisation or even issues: what’s best for your use case can be totally different from what works for others. essentially you should not see real difference if you disable proxying, because as said above nginx will then simply pass through everything.

if you see 504s that means you most likely run into a connection or rate limit between nginx and apache2 and therefore should have a look at additional modules you might use in good faith to maybe rate limit request and such things.

example: if you try to limit things within apache scope based on source IPs - bad idea behind nginx as proxy, because all requests for apache seem to come from your internal IP. if you turn nginx off completely this of course will be different…

however, just saying maybe investigate those 504s first :wink: