I encountered this error yesterday after upgraded php-*
packages then restart its service. All my websites were stopped working, I got ‘File not found.’ message on the screen and found the ton repeated of error messages in log of nginx Primary script unknown.
nginx
Comprehensive guide to FIX Connection lost Error in WordPress
Connection Lost Error is the following error message might occur while you are uploading, inserting media (image) files, publishing a post or saving draft.
“Connection lost. Saving has been disabled until you’re reconnected. We’re backing up this post in your browser, just in case.”
It may take a few seconds or over 10 minutes for that connection issue to clear. During that time you can’t save a draft or publish an article. At first, I thought there was something wrong with my activated plugins, themes… so I tried deactivating all my plugins, updating and changing to default themes, downgrading the version of WordPress and everything but the error still occurs. Very frustrating.
I found the problem must occur due to a technical glitch which leaves site owners frustrated and clueless. So then, in this post, I will help you understand the real reasons behind this error and how to resolve it efficiently.
How to Fix and Avoid WordPress Blank Page on NGINX
On Windows OS – the most popular opearting system for personal users, we have Blue Screen of Death as most common error screen. And with Nginx – the one of most popular web server softwares, we have White/Blank Screen of Death too. Unlike Windows Error Page, you won’t find useful information when facing with that problem because the it’s set hide from public by default, you need research the nginx and php logs to solve it.
If you don’t have a lot of experience with nginx, you will confusing with this common error like 403 Forbidden problem. In this post, I will explain about the solution to fix and avoid White/Blank Page when running WordPress on Nginx.
Move from PHP to HHVM to improve websites performance
For a long time ago, I’m not writing any article about the server (nginx) optimization because my VPS that’s powered by Digital Ocean is working flawlessly on the lowest plan with just $5/month.
Do you know? If you do over optimization on the lowest VPS hardware on Digital Ocean, it will decrease your server performance instead the good results which you’ve expected. Although it can’t improve by itself, you really want to make it… better by switch from php-fpm
to hhvm
.
HOW TO Solve Common NGINX Problems
Fist of all, I write this article to collect all the ways which I used for solved most common Nginx problems during VPS / Server setup process. That mean this post will continuing update until I move to another web server softwares for example: lighttpd, litespeed, ...
If you’re new or old to Nginx, you’ll facing with some problems, some of them can be solve easy with simple steps but we spend a lot time to research and fix it. Why? Did you know? The most frequent issue we see happens when someone attempts to just copy and paste a configuration snippet from some other guide. It’s the answer. Don’t follow the guides out there unless you can understand what they’re trying to do and can clean it up. You’ll solving almost common problems of Nginx.
Varnish + Nginx in comparison with Nginx alone, which is better?
Like others, I confused with the combine of Varnish + Nginx and Nginx alone on my server. But since I optimized new server with only Nginx, FastCGI Cache, Memcache. I’ve found a lot of talk about using Nginx with Varnish or not around the Internet. Isn’t Nginx enough?
The Quick Answer: I choosed Nginx alone without Varnish because I’ve found Varnish ~5% faster for small static files than Nginx but I will have to spend more time to maintaining and configuring it to works as I experct. It is not worth my effort!
This arctile will explain the reason that I don’t use Varnish with Nginx like Apache before.
Recommended Nginx Configuration for High Traffic WordPress on Small VPS (512 RAM)
A mere half-year ago, I was published two article to guide you setup perfect VPS on Digital Ocean and the guidelines to optimize LAMP (Linux, Apache, MySQL, PHP) web server on lowest VPS hardware plan. My VPS that’s optimized with Varnish, W3 Total Cache, PHP-APC was powered on since November 2013 until now without any reboot or reset. I estimate my server could easily handle 50K – 100K page views per day. At that point I would be close to breaking 95% memory usage (with swap file). In just an afternoon last week, my server was survival with 280K page views, without any downtime.
Guidelines to setup a perfect Digital Ocean VPS
As you can see, since last week, I did not publish new post because I have moved to Digital Ocean after a trial month. In the last few years I’ve used a lot of hosting providers. If you aren’t aware, I’ve been with HostGator for years, but after the last few months, I’ve been noticing their VPS services were slow. As my previous hosting contract was coming to an end and my friend has recommended Digital Ocean, I decided to take a look and was instantly surprised. DigitalOcean was just what I was looking for. Until now I’ve never actually found any that have been able to satisfy my needs at the right price. In this post, I’m going to let you guys know why I switched and why Digital Ocean is my host of choice right now.