Setup a WordPress development environment using Docker Compose

In this tutorial we’re going to use Docker to set up a WordPress development environment. It will consist of:

  • A MariaBD database container;
  • One or more WordPress containers; and
  • A front-end reverse-proxy to allow access to all of them though localhost.

Continue reading →

Security rules for Nginx 2 – The 6G Firewall

The folks over at Perishable Press publish a decent firewall set of rules that can stop a lot of common script-kiddie attacks. This is known as the 6G Firewall.

The original firewall in the link is written to be used in the .htaccess file in a website’s root folder. Since we’re using Nginx, and Nginx ignores .htaccess, we need to use a different method if we want to implement these rules.

Continue reading →

Security rules for Nginx 1 – Basic rules

This tutorial goes over how to set up basic security rules for hosting a WordPress website behind an Nginx reverse proxy that also serves cached and static content.

One of the biggest advantages of Apache as a web server is its flexibility to implement custom-level access and security rules through its .htaccess file. For example, many security plugins make heavy use of .htaccess to implement their policies.

Continue reading →

Caching With Nginx and Wordpress

This tutorial will show you how to setup caching with Nginx and WordPress. You can combine your Nginx reverse proxy with an open-source WordPress plugin that caches dynamic content. This means you can serve the cached, static HTML files directly with Nginx. This approach takes the best of both worlds: you make use of the speed and low resource needs of Nginx to do most of the work, but you can still use Apache-PHP to handle dynamic queries when the content does not exist in the cache. As I said in a previous post, if you’re using Nginx to serve content directly, you should be aware that it ignores .htaccess files and you need to implement a security policy in addition to what you use for Apache.

Continue reading →

Nginx Proxy Serving Static Content

This tutorial will show you how to set up an Nginx proxy serving static content such as images directly and pass dynamic queries onto Apache.

In the last tutorial we set up Nginx, a lightweight and fast web server, as a front-end in Debian 9 to proxy requests to Apache web servers in the back end. We can take advantage of the power and flexibility of Apache to serve dynamic PHP content, such as a WordPress website. Also we can also make good use of the speed and small memory footprint of Nginx to serve the static content.

Continue reading →