/nginx-conf-template

A bundle of nginx configuration such as load balancer, reverse proxy, static content, etc.

NGINX Configuration Template

This repo contains a bundle of NGINX configurations such as, load balancer, reverse proxy, static html php etc.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them on your ubuntu server

sudo apt install nginx

High Level Configuration

Static HTML Content

This configuration makes the nginx to serve the static content of HTML.

alt text

Reverse Proxy

alt text

Load Balancer

Load balancer configuration will distribute the load among several servers. You can determinte the load distribution for each server.

alt text

Installing

  1. Determine which configuration you need.
  2. Download the particular configuration you need either load balancer, proxy pass, static content, etc.
  3. Move the file to /etc/nginx/sites-available.
sudo cp the-config-file /etc/nginx/sites-available/the-config-file
  1. Fit the config file with your real scenario.
  2. Create a symlink to /sites-enabled
sudo ln -s /etc/nginx/sites-available/the-config-file /etc/nginx/sites-enabled/

Running the tests

sudo nginx -t

If the response is OK then you go to deployment. If the response is error, please fix the configuration file. Check the configuration with your real scenario.

Deployment

sudo nginx -s reload

Authors