2、nginx使用
Nginx使用
目录
[toc]
简介
Nginx 是非常重要的负载均衡中间件,被广泛应用于大型网站架构,下面我就全面来详解 。
Nginx 是一款轻量级的高性能的 Web 服务器和反向代理服务器,是由俄罗斯的程序设计师 Igor Sysoev 所开发。
Nginx 处理高并发能力是十分强大的,能经受高负载的考验,有报告表明能支持高达 50,000 个并发连接数。
Nginx 是一个很牛的高性能Web和反向代理服务器, 它具有有很多非常优越的特性;
在高连接并发的情况下,Nginx是Apache服务器不错的替代品,目前Web服务器调查显示Apache下降Ngnix攀升,linux下更多的服务商选择了Ngnix放弃了Apache;
Nginx在美国是做虚拟主机生意的老板们经常选择的软件平台之一. 能够支持高达 50,000 个并发连接数的响应, 感谢Nginx为我们选择了 epoll and kqueue作为开发模型.
目前中国大陆使用nginx网站用户有:新浪、网易、 腾讯,另外知名的微网志Plurk也使用nginx。
而Nginx专门为性能优化而开发,性能是最重要的考量,非常注重效率,Nginx能够支持高达50000个并发连接响应数。特点
由于以下这几点,所以使用 Nginx 非常火,在互联网项目中广泛应用。
-
相较于 Apache 具有占有内存少、稳定性高、并发能力强等优势;
-
Nginx 使用基于事件驱动架构,使得其可以支持**数以百万级别的 TCP 连接**;
-
高度的模块化、扩展性好、和自由软件许可证、使得第三方模块层出不穷;
-
Nginx 是一个跨平台服务器,可以运行在 Linux、Windows、Mac OS 等操作系统上。
功能应用
1. 正向代理
正向代理最大的特点是:客户端非常明确要访问的服务器地址,服务器只清楚请求来自哪个代理服务器,而不清楚来自哪个具体的客户端,正向代理模式屏蔽或者隐藏了真实客户端信息。