I tried to retain the NGINX FastCGI cache and have it persist across system reboots instead of being ephemeral by default. In order to achieve this goal I needed to create a shell script, define a new systemd service unit, and find a way to run the systemd shell script before shutdown (reboots are included via "Before=" declaration). This site is configured to store the cache in its tmpfs file system, which is a special Linux in-memory file system that abstracts and exposes itself typically to a directory such as /run. When the system is restarted (crashes in my case) […]
This guide will explain how to migrate and dockerize an existing WordPress installation without running Apache. Most other tutorials I’ve seen combine multiple services inside of one container, while this article tries to maintain the standard of one service per container for easier isolation, troubleshooting, performance, and scale-out. This consists of configuring multiple Docker containers with docker-compose on Ubuntu 16.04 Xenial to run MariaDB 10.0.31 or MySQL, Nginx 1.13, PHP7.1-FPM and WordPress 4.8. There are many tutorials for creating new WordPress sites with Docker containers such as this one, however there aren’t many for those who already have a site and want to migrate existing […]
Chances are this is not the first website you’ve come to after breaking SSL on your Nginx box, but I promise it will be the last. The problem is actually a very simple one, and the Nginx error log tells you verbatim what is wrong with the config, although nginx -t will yield success. Nginx reads and runs the sites in alphabetical order, therefore this issue can be fixed by finding and fixing the site config which is listening on port 443 and using ssl without any ssl certificate declarations which is causing your site further down the alphabetical line to fail HTTPS. In my case it was a Nginx site config called stub_status.conf causing SSL to fail in sysinfo.io.conf even though I did have SSL correctly setup.
Nginx can proxy requests using http, FastCGI, uwsgi, SCGI, or memcached. In this guide, we will discuss FastCGI proxying, which is one of the most common proxying protocols. Nginx has become one of the most flexible and powerful web server solutions available. However, in terms of design, it is first and foremost a proxy server. This focus means that Nginx is very performant when working to handle requests with other servers. Nginx has built-in support for fastcgi_cache but it doesn’t have a mechanism to purge cached content built-in. So we need to rely on a third-party nginx module. Without this 3rd party module, the […]
Surprisingly this hasn’t been covered more thoroughly considering how many people are running NGINX as a reverse proxy for their back end CMS such as WordPress. This article will show you how to configure NGINX with SSL and redirect to non-www. If your WordPress installation is sitting behind a reverse proxy like NGINX, WordPress won’t be able to see the proper IP address of the client computer for your accurate statistics and reporting. Instead WordPress will show your reverse proxy instead of the correct client IP addresses. If you’re using Cloudflare then there are various plugins to fix that, for NGINX there is not. To […]
How To Create Temporary and Permanent Redirects with Apache and Nginx