下载相关依赖软件包
yum -y install wget make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
wget http://nginx.org/download/nginx-1.10.2.tar.gz
tar -xzvf nginx-1.10.2.tar.gz
安装Nginx
cd nginx-1.10.2
./configure --prefix=/data/apps/nginx-download \
--pid-path=/data/logs/nginx-download/nginx.pid \
--lock-path=/data/apps/nginx-download/nginx.lock \
--error-log-path=/data/logs/nginx-download/error.log \
--http-log-path=/data/logs/nginx-download/access.log \
--http-client-body-temp-path=/data/temps/nginx-download/client_body_temp \
--http-proxy-temp-path=/data/temps/nginx-download/proxy_temp \
--http-fastcgi-temp-path=/data/temps/nginx-download/fastcgi_temp \
--http-uwsgi-temp-path=/data/temps/nginx-download/uwsgi_temp \
--http-scgi-temp-path=/data/temps/nginx-download/scgi_temp \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_ssl_module
make
make install
Nginx配置访问FastDFS
vim /data/apps/nginx-download/conf/nginx.conf
upstream fdfs_group1 {
server 192.168.0.2:9999;
server 192.168.0.3:9999;
}
upstream fdfs_group2 {
server 192.168.0.4:9999;
server 192.168.0.5:9999;
}
location /group1 {
proxy_pass http://fdfs_group1;
}
location /group2 {
proxy_pass http://fdfs_group2;
}
启动Nginx
mkdir -p /data/temps/nginx-download/client_body_temp
/data/apps/nginx-download/sbin/nginx