nginx 一些简单访问控制模块

nginx 已经内置了一些简单的访问控制模块,利用好这些模块我们可以提升系统的安全

几个比较有用的标准模块

基本都是利用了access 阶段的能力

  • limit_except 限制请求方法的(类似白名单,可以与access 集成使用)
  • access 的allow 以及deny (ip 防护,支持基于cidr 模式的)
  • auth_basic basic auth 模式
  • auth request (默认没有构建,可以自定义请求地址的auth 认证)
  • limit conn 以及limit req 限制流量以及请求连接的
  • referer 模块的,简单referer处理(可以做一些简单的referer 安全控制)

三方扩展模块

比如利用openresty lua 模块,社区开发的ldap,jwt 。。。。。

说明

安全对于nginx 是比较重要的,因为业务直接基于nginx 进行了访问,如果不能更好的支持安全控制,我们的业务系统安全风险就比较大了

参考资料

https://nginx.org/en/docs/http/ngx_http_core_module.html#satisfy
https://nginx.org/en/docs/http/ngx_http_core_module.html
https://nginx.org/en/docs/http/ngx_http_access_module.html
https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html
https://nginx.org/en/docs/http/ngx_http_auth_request_module.html
https://nginx.org/en/docs/http/ngx_http_limit_conn_module.html
https://nginx.org/en/docs/http/ngx_http_limit_req_module.html
https://nginx.org/en/docs/http/ngx_http_realip_module.html
https://nginx.org/en/docs/http/ngx_http_userid_module.html
https://nginx.org/en/docs/http/ngx_http_referer_module.html

posted on 2022-08-15 09:40  荣锋亮  阅读(58)  评论(0编辑  收藏  举报

导航