nginx简单反向代理实现

在NFS服务器对目录进行发布
vi /etc/exports
/opt/xcw 10.11.80.*(rw,sync,no_root_squash) 
service nfs restart

4、登录静态WEB服务器
mkdir attachment
mount -t nfs 10.11.80.226:/home/attachment /var/www/ku/attachment
mkdir avatar
mount -t nfs 10.11.80.226:/home/avatar /var/www/ku/avatar
mount -t nfs 10.10.70.90:/var/avatar /var/www/ku/90/avatar
mount -t nfs 10.10.70.90:/var/attachment /var/www/ku/90/attachment


6、登录主WEB服务器进行反向代理目录
   location /attachment/
        {
          proxy_pass http://10.11.80.223/attachment/;
          proxy_set_header Host $host;
        }

   location /ucenter/data/avatar/
        {
          proxy_pass http://10.11.80.223/avatar/;
          proxy_set_header Host $host;
        }

你可能感兴趣的:(nginx)