How Do You Troubleshoot a Docker Container Supporting a Web Service That Web Browsers Cannot Seem to Reach?

Problem scenario
You have configured a Docker container with a web service (e.g., Apache web server or Nginx).  You configured the listening, external port to be 80 or a different port number.  You find the web server (either Apache or Nginx) is not working from a web browser.  How do you find what is wrong?

Solution
#1  Use nmap to test the port and IP address. 

How Do You Use the least_conn Directive in an Nginx Configuration File?

Problem scenario
You have configured Nginx to be an HTTP load balancer (a web server configured to behave as a landing portal that enables traffic to pass through).  As a reverse proxy with built-in keywords you have use the “least_conn” directive, but it does not seem to be working.  You want inbound network connection requests from your users via web browsers to be relayed to the web servers with the fewest (or least) amount of active connections. 

How Do You Set up Nginx as an HTTP Load Balancer So Client Requests (from Web Browsers) Do Not Go to Certain Nginx Servers unless Others Are Down?

Problem scenario
You have a web server running Nginx that acts as a reverse proxy server.  On occasion your regular web (Nginx) servers go down.  You want to have one or two web (Nginx) servers that are  reserved as backups exclusively.  You do not want traffic going to these servers unless the main Nginx servers are unavailable (either due to network or server failure).  You can allocate RAM and CPU to these reserved servers on demand. 

How Can Nginx Be an HTTP Load Balancer for Apache Web Servers?

Problem scenario
You have an Nginx server that you want to be a traffic distributor to Apache web servers.   What has to be done to configure Nginx’s HTTP load balancing function to relay inbound connection requests to Apache web servers?

Solution
Nothing special has to be done for the web servers.  Nginx can be a reverse proxy to either Nginx web servers or Apache web servers. 

How Do You Install Gatling on a CentOS/RHEL/Fedora server?

Problem scenario
You are using a Red Hat derivative of Linux.  You want to install Gatling.  What do you do?

Solution
Prerequisite

Install Java.  If you need assistance, see this posting.

Procedures
1.  Run a script with the following content (e.g., name it installgatling.sh and run sudo bash installgatling.sh):

gatlingversion=3.3.1 # change this version as needed. …

How Do You Find the Number of Active Connections That an Nginx HTTP Load Balancer Has?

Problem scenario
You have an Nginx instance configured to be an HTTP load balancer (aka invisible landing page, pass-through distributor or reverse proxy).  You want to analyze the inbound web traffic that your Nginx server is currently receiving.  How do you find out how many active connections there are through the load balancer?

Solution
1.  Modify the /etc/nginx/conf.d/default.conf file in the Nginx HTTP load balancer. 

How Do You Set up HAProxy on a Linux Server?

Problem scenario
You have some web servers that you want a new HAProxy server to distribute traffic to.  You have an Ubuntu or Debian Linux server that you want HAProxy installed on.  You want HAProxy to be a load balancer. What do you do?

Solution
Prerequisites

You have at least two web servers set up and you know their IP addresses (either internal or external). 

In the Context of Nginx, What Is the Difference between the default.conf and nginx.conf Files?

Question
In the Context of Nginx, What Is the Difference between the default.conf and nginx.conf Files?

Answer
For general Nginx purposes, the nginx.conf file specifies the location of the Nginx logs and the names of the log files themselves.  

For general Nginx purposes, the default.conf handles many more configuration items than nginx.conf.   The default.conf file will allow you to configure a non-standard port (other than port 80) and specifies if Nginx will act as a load balancer or a web server. 

How Do You Use TLS with Nginx?

Problem scenario
You know how to use TLS with Node.js because of this article.  You want to use TLS with Nginx to test it out with a regular web browsing session.  You want to implement TLS without Node.js.  How do you set up TLS (without paying a certificate authority and without Node.js)?

Solution
This assumes that port 443 is not blocked from the workstation to the Nginx server.