首页 > 其他 > 详细

nginx负载均衡&文件服务器配置

时间:2015-12-29 16:20:39      阅读:151      评论:0      收藏:0      [点我收藏+]

1、负载均衡,/usr/local/nginx/nginx.conf添加stream即可

http{
....
}
stream {
        server {
                listen          8080 reuseport;
                proxy_pass      netty;
        }
        upstream netty {
                server  192.168.180.68:8080;
                server  192.168.180.69:8080;
        }
}

2、添加文件服务器,在http中

server {
        listen       80;
        server_name  192.168.180.67;
        location / {
                root   /opt/test;
                index  index.php index.html index.htm;
                autoindex on;
                autoindex_exact_size off;
                autoindex_localtime on;
                }
 }


本文出自 “lly0205.mofile.com” 博客,请务必保留此出处http://481814.blog.51cto.com/471814/1729525

nginx负载均衡&文件服务器配置

原文:http://481814.blog.51cto.com/471814/1729525

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!