Wordpress using nginx


Due to stability issues with our site we are revamping our server configuration.

I am running a wordpress site that I want to run the following way;

I have 2 servers. Server #1 and Server #2.

I want Server #1 to be the front end, and Server #2 to be the nginx proxy.

This way the files are being generated locally on Server #1, and then being copied by SSH/FTP to Server #2, the proxy.

By using this setup Server #2 keeps running even though Server #1 has any kind of problems.

At the moment I am using W3 Total cache for my caching, but it doesn’t support this configuration.

Can anyone point me in the right way to realise this?

What you are actually doing it moving the weak link to Server #2. If Server #1 fails sure it will satisfy that case, but what if Server #2 fails, what then? What you actually need is a cluster of servers that are load balanced with one another. Redundant Servers doing the same thing.

Basically, I call what you are doing, throwing a band aid on the real problem instead of fixing it.

No, because the site will continue running even if it can’t access the database, because it serves up static pages…

Thats not my point. What happens when Server #2 fails?

Correction: If server #2 fails we have a 3rd server to pick up the traffic.

I need a way to generate static pages from my wordpress site, which I then serve to people. But as I’m using Woocommerce, it’s been quite a hassle

Ecommerce stuff usually fails as static. Even if you can serve the pages, you can’t take orders.

Hit the real problem – stability in your wordpress setup.

I’ve macgyverd my forms and stuff into Iframes which I host externally, so that keeps working. I just want to convert my Wordpress/Woocommerce site into static html files which sync.

There are people out there doing similar to what you need with varnish e.g 1 [URL=“http://danielmiessler.com/blog/optimizing-wordpress-with-nginx-varnish-w3-total-cache-amazon-s3-and-memcached#nginx”]2 There was a wp varnish plugin but it’s not been updated in ages, but might prove a useful starting point. I’d always look to separate a caching proxy from your primary web server.

You can learn how to configure W3 Total Cache with WordPress-Nginx here.
If this didn’t solve your problem, please let me know

Thanks alot, I’m going to check this out and see if it works!

Will get back with the results

And I’ll be waiting… :slight_smile: