您的位置:首页 > 运维架构 > Nginx

Nginx学习--之基于Nginx的中间件架构

2017-12-17 01:21 537 查看
1.http请求

request -包括请求行、请求头、请求数据
respone -包括状态行、消息报头、相应正文


2.Nginx日包括error.log access_logginx变量

HTTP请求变量 -arg_PARAMETER 、 http_HEADER、 sent_http_HEADER
内置变量 - Nginx内置的
自定义变量 -自己定义


4.Nginx模块

官方

http_stub_status_module(nginx的客户端状态)
Systax:stub_status
Default:--
Context:server,location
http_random_index_moudule(目录中选择一个随机的主页)
Systax:random_index on|off
Default:random_index off
Context:location

http_sub_module(http内容替换)
Systax:sub_filter string(要替换的内容) replacement(替换后的内容);
Default:--
Context:http ,server,location

Systax:sub_filter_last_modified on|off;(检测有更新--应用于缓存)
Default:sub_filter_last_modified off;
Context:http ,server,location

Systax:sub_filter_once on|off;(on替换第一个,off替换所有)
Default:sub_filter_once on;
Context:http ,server,location


5.Nginxde的请求限制

连接频率限制 - limit_conn_module

请求频率限制 - linit_req_module


6.HTTP协议的连接与请求

HTTP协议版本    连接关系
HTTP1.0     TCP不能复用
HTTP1.1     顺序性TCP复用
HTTP2.0     多路复用TCP复用


7.连接限制

Systax:limit_conn_zone key zone=name:size;
Default:--
Context:http

Systax:limit_conn_zone number;(并发限制:数量)
Default:--
Context:http ,server,location


8.请求限制

Systax:limit_req_zone key zone=name:size rate=rate;
Default:--
Context:http

Systax:limit_req zone=name[burst=number][nodelay];
Default:--
Context:http , server, location


log_format

Systax:log_format name [escape = default|json] string …]

Default:log_format combined “…”

Context:http

nginx的访问控制

1.基于Ip的访问控制 http_access_moudule

Systax:allow address/deny |CIDR |unix: | all;

Default:–

Context:http,server,location,limit_except

2.基于用户的信任登录 http_auth_basic_module
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  nginx