Nginx和apache实现反向代理
时间:2015-09-28 19:04 来源:linux.it.net.cn 作者:IT
Nginx和apache实现反向代理
1.安装之前需要3个支持:gzip,pcre,openssl模块依赖性
gzip 模块需要 zlib 库
rewrite 模块需要 pcre 库
ssl 功能需要 openssl 库
2.检查是否安装了gzip,pcre,openssl
rpm -qa | grep "zlib"
rpm -qa | grep "pcre"
rpm -qa | grep "openssl"
3.预先编译好的安装包
gzip支持,需要zlib http://www.zlib.net/ 下载最新版即可
rewrite module requires pcre library http://www.pcre.org/ 下载最新版即可
ssl 功能需要 openssl 库 http://www.openssl.org/=> http://www.openssl.org/source/ LASTEST版本即可
4.安装nginx
tar zxvf nginx.tar.gz
./configure --with-http_ssl_module
Make
Make install
5.Nginx和apache实现反向代理
在配置文件nginx.cong中进行设置
http {
include mime.types;
default_type application/octet-stream;
upstream my_server_pool {
server 192.168.10.43:8088;
}
server {
listen 80;
server_name localhost;
#location / {
# root html;
# index index.html index.htm;
#}
location / {
proxy_pass http://my_server_pool;
}
}
}
(责任编辑:IT)
Nginx和apache实现反向代理 1.安装之前需要3个支持:gzip,pcre,openssl模块依赖性 gzip 模块需要 zlib 库 rewrite 模块需要 pcre 库 ssl 功能需要 openssl 库 2.检查是否安装了gzip,pcre,openssl rpm -qa | grep "zlib" rpm -qa | grep "pcre" rpm -qa | grep "openssl" 3.预先编译好的安装包 gzip支持,需要zlib http://www.zlib.net/ 下载最新版即可 rewrite module requires pcre library http://www.pcre.org/ 下载最新版即可 ssl 功能需要 openssl 库 http://www.openssl.org/=> http://www.openssl.org/source/ LASTEST版本即可 4.安装nginx tar zxvf nginx.tar.gz ./configure --with-http_ssl_module Make Make install 5.Nginx和apache实现反向代理 在配置文件nginx.cong中进行设置 http { include mime.types; default_type application/octet-stream; upstream my_server_pool { server 192.168.10.43:8088; } server { listen 80; server_name localhost; #location / { # root html; # index index.html index.htm; #} location / { proxy_pass http://my_server_pool; } } } (责任编辑:IT) |