nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解

nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解

ID:16467573

大小:394.80 KB

页数:36页

时间:2018-08-10

nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解_第1页
nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解_第2页
nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解_第3页
nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解_第4页
nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解_第5页
资源描述:

《nginx 反向代理、负载均衡、页面缓存、url重写及读写分离详解》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、大纲一、前言二、环境准备三、安装与配置Nginx四、Nginx之反向代理五、Nginx之负载均衡六、Nginx之页面缓存七、Nginx之URL重写八、Nginx之读写分离注:操作系统为CentOS6.5x84_64,Nginx是最新版1.4.4一、前言在前面的几篇博文中我们主要讲解了Nginx作为Web服务器知识点,主要的知识点有nginx的理论详解、nginx作为web服务器的操作讲解、nginx作为LNMP架构的讲解,不清楚的博友可以回头看看,在这一篇博客中我们主要讲解,nginx的反向代理、负载均衡、缓存、URL重写以及读写分离详解。好了,下面我们来具体

2、说一说。二、环境准备1.操作系统:CentOS6.5x84_642.软件:Nginx1.4.44.安装源:[root@localhostnginx]#rpm-ivhhttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm[root@web1~]#rpm-ivhhttp://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm5.各节点时间同步(root@nginx~)#

3、ntpdate202.120.2.101  (root@web1~)#ntpdate202.120.2.101  (root@web2~)#ntpdate202.120.2.1016.关闭防火墙与selinux#serviceiptablesstopchkconfigiptablesoffgetenforce三.安装Nginx1.解压[root@localhostnginx]#tar-zxvfnginx-1.4.4.tar.gz2.新建nginx用户与组[root@localhostnginx]#groupadd-g108-rnginx[root@localh

4、ostnginx]#useradd-u108-r-g108nginx[root@localhostnginx]#idnginx3.准备编译配置文件[root@localhostnginx]#yum-yinstallpcre-developenssl-devel[root@localhostnginx-1.4.4]#./configure--prefix=/usr/--sbin-path=/usr/sbin/nginx--conf-path=/etc/nginx.conf--error-log-path=/var/log/nginx/error.log--htt

5、p-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx/nginx.pid--lock-path=/var/lock/nginx.lock--user=nginx--with-http_ssl_module--with-http_flv_module--with-http_stub_status_module--with-http_gzip_static_module--http-client-body-temp-path=/var/tmp/nginx/client/--http-proxy-

6、temp-path=/var/tmp/nginx/proxy/--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi--http-scgi-temp-path=/var/tmp/nginx/scgi--with-pcre4.编译安装[root@localhostnginx-1.4.4]#make&&makeinstall5.为nginx提供SysVinit脚本[root@localhostnginx-1.4.4]#cat/etc/init.

7、d/nginx#!/bin/sh##nginx-thisscriptstartsandstopsthenginxdaemon##chkconfig:-8515#description:NginxisanHTTP(S)server,HTTP(S)reverse#proxyandIMAP/POP3proxyserver#processname:nginx#config:/etc/nginx/nginx.conf#config:/etc/sysconfig/nginx#pidfile:/var/run/nginx.pid#Sourcefunctionlibrary

8、../etc/rc.d/init.d/

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。