随笔 - 502  文章 - 1 评论 - 6 阅读 - 37万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

日期格式 

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;
}
复制代码

 

posted on   1161588342  阅读(109)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2018-07-17 Spring boot 数据访问JDBC
2018-07-17 JVM jstack 详解
点击右上角即可分享
微信分享提示