Debian/Ubuntu Nginx installation, reverse proxy, and basic load balancing configurations, using tung.pdf

Source: Internet
Author: User

Debian/Ubuntu Nginx installation, reverse proxy, and basic load balancing configurations, using tung.pdf
Source code Installation

Go to the Nginx official website to download the latest stable version, here is the nginx-1.6.3 version.
After the download is complete, decompress the package and enter the directory for execution:


If your machine is not installedPCERLibrary,zlibLibrary.

sudo apt-get install libpcre3-dev zlibc zlib-bin

Then execute:

sudo makesudo make install

Nginx is installed on/usr/local/nginxDirectory.

Basic configuration of reverse proxy

The default configuration file used by nginx is/user/local/nginx/conf/nginx.conf. If the upstream Server is a JBoss cluster, you canhttpBlock to configure as follows:

upstream jboss {    server localhost:8080;    server xx.xx.xx.xx:port    server server-domain-name}

serverBlock to configure as follows:

location / {    proxy_pass http://jboss;}
Simple ip_hash Configuration

In most cases, if nginx is used as the load-based machine, we all want to deliver the same ip address to the game server on the same server every time. The configuration is as follows:

upstream jboss {    ip_hash;    server localhost:8080;    server xx.xx.xx.xx:port;    server server-domain-name}

In this case, if a JBoss fails to be used, you cannot directly Delete the JBoss address from the preceding configuration. Instead, you must:

upstream jboss {    ip_hash;    server localhost:8080;    server xx.xx.xx.xx:port down;    server server-domain-name;}

Then execute

/usr/local/nginx -s reload

Reload the configuration file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.