Lab requirement: Use nginx to build a reverse proxy server and distribute user requests to backend web Server groups 192.168.100.1 and 192.168.100.2 Intranet web server 192.168.100.1 Intranet interface eth0 (192.168.1.254) ----------- nginx reverse proxy
Lab requirement: Use nginx to build a reverse proxy server and distribute user requests to backend web Server groups 192.168.100.1 and 192.168.100.2
Intranet web server 192.168.100.1 Intranet interface eth0 (192.168.1.254)
----------- Nginx reverse proxy server ------------ Internet client 1.1.1.1
Intranet web server 192.168.100.2 public network interface eth1 (1.1.1.254)
CentOS 6.2 Deployment Nginx + MySQL + PHP http://www.linuxidc.com/Linux/2013-09/90020.htm
Build a WEB server http://www.linuxidc.com/Linux/2013-09/89768.htm with Nginx
Build a Web server http://www.linuxidc.com/Linux/2013-09/89692.htm Based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Nginx Performance Tuning http://www.linuxidc.com/Linux/2013-09/89656.htm in CentOS 6.3
Configure Nginx to load ngx_pagespeed module http://www.linuxidc.com/Linux/2013-09/89657.htm under CentOS 6.3
CentOS 6.4 install and configure Nginx + Pcre + php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm
Nginx Video-on-Demand Server (professional simulation streaming media software) http://www.linuxidc.com/Linux/2012-08/69151.htm
1. Deploy the Intranet website server 192.168.100.1
You can use apache, nginx, and other software to build the experiment.
1. install the software and edit the configuration file
# Vim/usr/local/nginx/conf/nginx. conf
Http {
......
Server {
Listen 80;
Server_name www.linuxidc.com
Location /{
Root html;
Index index.html index.htm;
}
}
......
2. Create a test webpage File
# Echo 192.168.100.1>/usr/local/nginx/html/index.html
3. Start the service
# Cd/usr/local/nginx/sbin
#./Nginx
2. Deploy the Intranet website server 192.168.100.2
1. install the software and edit the configuration file
# Vim/usr/local/nginx/conf/nginx. conf
Http {
......
Server {
Listen 80;
Server_name www.linuxidc.com
Location /{
Root html;
Index index.html index.htm;
}
}
......
2. Create a test webpage File
# Echo 192.168.100.2>/usr/local/nginx/html/index.html // to test the effect, create different webpages on the two servers
3. Start the service
# Cd/usr/local/nginx/sbin
#./Nginx
3. Configure the nginx Reverse Proxy Server
1. install the software and edit the configuration file
# Vim/usr/local/nginx/conf/nginx. conf
......
Http {
......
Upstream sergrp {// define the source server group
Server 192.168.100.1: 80;
Server 192.168.100.2: 80;
}
Server {
Listen 80;
Server_name www.linuxidc.com; // web host name
Location /{
Root html;
Index index.html index.htm;
Proxy_pass http: // sergrp; // call the server group
......
2. Release port 80 and start the service
# Service httpd stop // if the web service is enabled on this server, it is disabled or enabled on another port
# Chkconfig httpd off
# Cd/usr/local/nginx/sbin
#./Nginx
For more details, refer to the highlights on the next page.: Http://www.linuxidc.com/Linux/2014-05/102219p2.htm