Skip to main content


Showing posts from September, 2018

Reverse Proxy/Load Balancing with Nginx

Today we’re going to be talking about reverse proxy/load balancing with Nginx. Why is this important? It comes down to not wanting your web apps to have one single point of failure. Performance also plays a big role here. With reverse proxying, there are 3 load balancing methods:

1) Round Robin (goes around in a circle of servers essentially).
2) Least-connected (goes to the server with the least amount of load)
3) IP Hash (chooses what server should be used for the next request

For our testing purposes, we will have 3 servers. Two of them are RedHat 7.5 and the third is Ubuntu 18.04. All of these servers will have Nginx configured.
The first thing we want to do is confirm connection between all servers. In a production environment, you would confirm they’re all on the same subnet and have communication between one-another. In something cloud based like AWS, you would want to confirm they’re in proper security groups that allow certain types of connection and communication. This is ou…

LEMP stack (minus the PHP)

Today we’re going to be talking about building a LEMP stack! Many of you may be familiar with LAMP stacks (Linux Apache MySQL PHP). A LEMP stack is Linux, Nginx, MySQL and PHP (however we’re substituting PHP with Python because.. well…. Php.

I’m currently using a KVM server with a Linux Mint jumpbox. I SSH in with the -X switch to bring up the virt-manager GUI. However, you do not need this. This config can work whether you’re running a Linux VM on Hyper-V, ESXi, KVM, OpenStack, AWS, Azure, etc. You can even do this on a local Linux install.

The first thing we’re going to do is pick a Linux distro. As I love me some RedHat, we’re going to go with the free developer license for RedHat. You can sign up for this on RedHat’s subscription site and have up to 16 VM’s licensed and subscribed for free. If you do not want to do this, feel free to download CentOS.

The first thing we will install is the epel-release repo. This is due to yum missing some packages. The two ways to do this are;