Nginx Preview

简单介绍

2004年发布第一个版本,2011年成立公司提供商业支持,2019年3月被F5 6.7亿美元收购

拥有反向代理,负载均衡,http缓存等功能

特点

为fastcgi 提供负载均衡

采用epoll非阻塞io模型提供高并发能力

Apache

作为当时全球使用率最高的http 服务器,nginx的目标就是超越apache性能并已高性能为切入点抢占http 服务器市场

apache 采用select 模型,nginx 采用epoll模型,由于技术选型原因,nginx拥有先天优势带来高性能

模块

http

  1. ngx_http_core_module
  2. ngx_http_access_module 提供基础黑名单白名单功能
  3. ngx_http_addition_module 在请求之前或者之后添加文本
  4. ngx_http_api_module 提供 REST API 用来查看nginx各种状态
  5. ngx_http_auth_basic_module HTTP基本身份验证判断是否有权限
  6. ngx_http_auth_jwt_module jwt验证
  7. ngx_http_auth_request_module 根据请求授权是否可以访问
  8. ngx_http_autoindex_module 自动生成文件夹列表
  9. ngx_http_browser_module 判断浏览器是否是现代浏览器与ie
  10. ngx_http_charset_module 设置响应字符集
  11. ngx_http_dav_module WebDAV 模块
  12. ngx_http_empty_gif_module 空白图片输出
  13. ngx_http_f4f_module Adobe HTTP动态流
  14. ngx_http_fastcgi_module fastcgi支持
  15. ngx_http_flv_module flv视频支持
  16. ngx_http_geo_module 使用ip地址进行变量映射
  17. ngx_http_geoip_module 使用ip地址进行区域位置转换
  18. ngx_http_grpc_module grpc代理
  19. ngx_http_gunzip_module 在header中有gzip压缩选型但是客户端不支持gzip的时候生效
  20. ngx_http_gzip_module 使用gzip传输数据
  21. ngx_http_gzip_static_module 压缩后的文件存储为.gz 下次请求时直接输出文件
  22. ngx_http_headers_module 追加响应header
  23. ngx_http_hls_module 对视频文件提供实时流访问
  24. ngx_http_image_filter_module 对图片进行旋转,剪切
  25. ngx_http_index_module 入口执行文件
  26. ngx_http_js_module js模块
  27. ngx_http_keyval_module 定义key val变量
  28. ngx_http_limit_conn_module 限制某个ip的连接数
  29. ngx_http_limit_req_module 限制某个ip的请求数,使用漏桶规则
  30. ngx_http_log_module 日志
  31. ngx_http_map_module 定义map变量
  32. ngx_http_memcached_module 代理memcached
  33. ngx_http_mirror_module 镜像网站
  34. ngx_http_mp4_module mp4流式传输
  35. ngx_http_perl_module
  36. ngx_http_proxy_module 代理http
  37. ngx_http_random_index_module 随机index
  38. ngx_http_realip_module ip替换
  39. ngx_http_referer_module 阻止无效Referer
  40. ngx_http_rewrite_module uri 重写
  41. ngx_http_scgi_module scgi代理
  42. ngx_http_secure_link_module 检查请求链路的真实性
  43. ngx_http_session_log_module
  44. ngx_http_slice_module 将一个请求拆分为多个请求
  45. ngx_http_spdy_module
  46. ngx_http_split_clients_module 定义ab测试变量,不同的客户端拆分到不同的后端
  47. ngx_http_ssi_module ssi 支持,将文件潜入到网页
  48. ngx_http_ssl_module ssl支持
  49. ngx_http_status_module nginx 状态
  50. ngx_http_stub_status_module nginx基本状态
  51. ngx_http_sub_module 替换字符串来修改响应结果
  52. ngx_http_upstream_module upstream模块
  53. ngx_http_upstream_conf_module 通过http请求动态配置upstrem
  54. ngx_http_upstream_hc_module upstream中的服务器进行健康检查
  55. ngx_http_userid_module 基于cookie设置客户端唯一标标识
  56. ngx_http_uwsgi_module uwsgi 代理
  57. ngx_http_v2_module http2.0
  58. ngx_http_xslt_module 使用XSLT 转换 xml

mail

  1. ngx_mail_core_module
  2. ngx_mail_auth_http_module
  3. ngx_mail_proxy_module
  4. ngx_mail_ssl_module
  5. ngx_mail_imap_module
  6. ngx_mail_pop3_module
  7. ngx_mail_smtp_module

stream

  1. ngx_stream_core_module
  2. ngx_stream_access_module
  3. ngx_stream_geo_module
  4. ngx_stream_geoip_module
  5. ngx_stream_js_module
  6. ngx_stream_keyval_module
  7. ngx_stream_limit_conn_module
  8. ngx_stream_log_module
  9. ngx_stream_map_module
  10. ngx_stream_proxy_module
  11. ngx_stream_realip_module
  12. ngx_stream_return_module
  13. ngx_stream_split_clients_module
  14. ngx_stream_ssl_module
  15. ngx_stream_ssl_preread_module
  16. ngx_stream_upstream_module
  17. ngx_stream_upstream_hc_module
  18. ngx_stream_zone_sync_module

other

  1. ngx_google_perftools_module