How Do You Make a Web UI Service Accessible to Outside Web Browser Traffic?

Problem scenario
Sometimes you have a web service listening on the loop back IP address on a non-standard port.

When you run nmap -Pn localhost, you see a service is listening on a given port (e.g., 9200). When you run nmap -Pn on an internal or external IP address, you do not see a service listening on that given port. You want to direct traffic to this listening service (e.g.,

 » Read more..

How Do You Set up Nginx as an HTTP Load Balancer for Other Instances of Nginx Running in Docker?

Problem scenario
You have many Docker containers running Nginx.  You want to leverage these instances for users to go to one web site and then be automatically routed to different underlying Nginx instances in Docker containers.  How do you create a single website for web clients to go to with a reverse proxy balancing the load behind-the-scenes?

Solution
Overview
We accomplish an example with four Docker containers each using a free version of Nginx. 

 » Read more..

How Do You Set up Nginx as an HTTP Load Balancer So Client Requests (from Web Browsers) Go to Certain Nginx Servers More Frequently Than Others?

Problem scenario
You have certain Nginx servers with ample resources whereas others have minimal resources.  Based on geographic locations and data center bandwidth locations and costs, you want to assign fractions of the web traffic from client workstations (requests from web browsers) to different Nginx servers more than others.  You do not want round-robin, equal distribution of traffic.  You want customized HTTP load balancing in accord with unequal configurations.  How do you distribute this traffic proportionately according to your desired specifications?

 » Read more..

Where Is The “Welcome to Nginx!” Page Stored in a Docker Container?

Problem scenario
You installed Nginx in a Docker container on a RedHat Linux server.  You go to this container with a web browser and see the default screen.  Where is the default file (on the back-end) that users see from the front-end by default that says “Welcome to nginx!”?

Solution
This is the name and location of the file (assuming the Docker container was created via the public repository):

/usr/share/nginx/html/index.html

 » Read more..

Which Log File Shows a Record of Web Traffic on an Nginx Web Server Running on a Linux?

Problem scenario
You configured Nginx on a Linux server. You want to see if there has been activity on the website (e.g., via a web browser). What log file, visible on the back-end, has records of web browsing activity?

Solution
It is often here: /var/log/nginx/access.log

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

 » Read more..

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.  If you are using Windows,

 » Read more..

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. 

 » Read more..

How Do You Get the Kibana Web UI to Work?

Problem scenario
You want to try out he Kibana web UI. You are using Linux. How do you get Kibana to work?

Solution
Prerequisites

Install the ElasticStack. If you need assistance, see “How Do You Install the Elastic Stack on Any Type of Linux?

Procedures

1. Install nginx. If you need assistance,

 » Read more..

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. 

 » Read more..

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.  The “upstream backend {}” block in the  file /etc/nginx/conf.d/default.conf in Nginx’s distributor instance merely has to have stanzas  like these:

upstream backend {
server apache.web.server.com;

 » Read more..