Adding Nginx in Front of WordPress

There are a few drawbacks to the 1-Click install. I’m planning to tinker with something really cool down the road to fix one of those problems (I know the future again). Luckily, I’m going to address my first initial concern in this post. What is that concern you ask? Protecting my WordPress admin of course! Sure, there are a number of WordPress vulnerabilities roaming around and talks of zero days and the sort. I make life easier on any attacker if I just leave my WordPress admin open to anyone. In this post, we look at taking my custom nginx and deploying it in front of my WordPress site to enforce IP access control to the admin page. ...

January 7, 2021 · 8 min · Scott

Testing Out the Digital Ocean Container Registry

Disclosure: I have included some affiliate / referral links in this post. There’s no cost to you for accessing these links but I do indeed receive some incentive for it if you buy through them. Building the Custom Nginx This part was pretty easy. I simply created a Dockerfile for the build. FROM ubuntu ENV DEBIAN_FRONTEND noninteractive MAINTAINER Scott Algatt RUN apt-get update \ && apt-get install -y libjansson-dev libcurl4-openssl-dev libapr1-dev libaprutil1-dev libssl-dev build-essential devscripts libtool m4 automake pkg-config libpcre3-dev zlib1g-dev\ && apt -y upgrade \ && apt -y autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ && curl -o /tmp/nginx.tgz http://nginx.org/download/nginx-1.18.0.tar.gz WORKDIR /tmp RUN tar zxf nginx.tgz \ && cd nginx-1.18.0 \ && ./configure --with-http_realip_module\ && make \ && make install EXPOSE 80 CMD ["/usr/local/nginx/sbin/nginx"] As you can see from the Dockerfile, this is a really super simple build. It is also not very custom aside from my compile command where I’ve added –with-http_realip_module. This little addition is something that I will use later in a future post (I know everything will be in the future) but you can see what it does by visiting the nginx documentation. Anyhow, there you go. Aside from the configure command, I’m just setting up ubuntu to compile code and I download nginx and compile it. Then expose port 80 and run nginx. ...

December 30, 2020 · 3 min · Scott