I am currently working on my WordPress blog, which is hosted on a VPS.NET VPS with Nginx as front end to Apache to serve static files, while Apache takes care of the PHP in FastCGI. This seems to be working great, however I haven’t yet managed to have Nginx serve WP-SuperCache files as well, which I would like for maximum performance (I am not planning to completely replace Apache with Nginx right now because I’ve got a Virtualmin license and it does not support Nginx).
I have tried a lot of rules found here and there but in the end none worked for me or I am missing something.
If Apache is stopped, in fact, I can still get images, stylesheets and javascript delivered to the browser by Nginx directly.
But if I try to surf the blog (with pages cached for sure by WP-SuperCache) with Apache stopped, all I get from Nginx is a “502 bad gateway”.
Any ideas would be greatly appreciated.
Many thanks in advance.
Leave a Reply
You must be logged in to post a comment.
Nginx can handle your fastCGI. Bundled with Nginx, generally, all Apache does is cost you resources.
Regarding WP Super Cache, if you create a new file and paste this, it’ll give you both that and, while we’re about it, FURLs…
Now, goto your virtual host file, or nginx.conf if you bundle your sites, and add a line like ..
.. where wordpress_params.super_cache is what you called the file we created, and given a path relative to that I’ve shown.
Then restart Nginx and turn on WP Super Cache plugin and, for the pretty links, add a permalink structure.
Fact is, there’s a lot to know about to get the Nginx install right, especially with WordPress and to configure fastCGI. If you like, this would be a good start for you…
.. Setup WordPress on NGINX (FURLs & Cache) – VPS Bible Pt 13
Re. Virtualmin .. I understand you want a CP, but truth is, the resource cost is greater than the cost of the software .. plus it takes way longer to do stuff with a CP.
I’m currently publishing a 21 part VPS Admin series which addresses the lack of an Nginx CP .. that’ll be all you need, frankly.
Given a week or two, I challenge you to tell me it’s quicker or otherwise better to use a CP 🙂
It seems silly to run Nginx through Apache.
Set up Nginx to serve up the php and dynamic pages itself and you’ll have a much faster service and won’t have the problem where apache dies and leaves your webserver(Nginx) hanging.
If your admin panel doesn’t support this, you probably should only be using apache in the first place. Either do one or the other, both is just asking for problems.
You may use FREE WordOps – WordPress site and server administration which already offers nginx configuration option (–wpsc) for WP Super Cache and other cache plugins.