Nginx 基础

日期格式 

http_请求头, arg_参数

使用 比如User-Agent 则 $http_user_agent

 log_format  名称  '$http_*******'

 

模块

sub_status          查看连接,请求状态  常配置在http server location中

random_index     随机主页

sub_filter             替换返回内容

       sub_filter '<h1>Admin' '<h1>ggggg'; //第一个参数是要被替换的,第二个参数是替换后的

  sub_filter_once off;   //替换所有的,默认是on,替换第一个

sub_filter_last_modified  on|off    修改最  常配置缓存时使用  default off

sub_filter_on    on|off   替换第一个字符串   default on

 

连接, 请求限制

 limt_conn_zone key zone=name:size

作用域 : http

 limit_conn zone(上面的名字) number;

作用域: http,server,location

 

 limt_req_zone key zone=name:size rate=rate;    rate=1r/s 表示每s一次

作用域 : http

 limit_req zone(上面的名字) [burst=number 下一秒多少可以请求] [nodelay];

作用域: http,server,location

 

访问模块 http_access_module

allow IP

deny all 

 

auth_basic 通过htpasswd 生成文件密码信息

 

 

 

  2 alias 与 root区别

 

 

IP黑白名单

# location ~ ^/admin.html {
# root /opt/app/code;
# deny 222.128.189.17;
# allow all;
# index index.html index.htm;
# }

location ~ ^/admin.html {
root /opt/app/code;
allow 222.128.189.0/24;
deny all;
index index.html index.htm;
}

 

转载于:https://www.cnblogs.com/eason-d/p/11201934.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值