关于fastdfs:FastDFS配置Nginx访问

35次阅读

共计 1254 个字符,预计需要花费 4 分钟才能阅读完成。

FastDFS 配置 Nginx 拜访

FastDFS 分布式文件系统装置和配置_亲测胜利

下载相干依赖软件包

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

正文完
 0