摘要: 在 Nginx 中,keepalive_requests 指令用于控制与客户端和代理服务器之间 keep-alive 连接的请求次数。在 HTTP 配置中,它控制 Nginx 与客户端之间 keep-alive 连接的请求次数。在 upstream 配置中,它控制 Nginx 与上游服务器之间 ke 阅读全文
posted @ 2023-07-28 17:03 焦耳|程 阅读(1476) 评论(0) 推荐(0) 编辑
摘要: package main import ( "flag" "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/promethe 阅读全文
posted @ 2023-01-07 14:56 焦耳|程 阅读(217) 评论(0) 推荐(0) 编辑
摘要: git describe --exact-match --tags $(git log -n1 --pretty='%h') git rev-parse --short HEAD) 阅读全文
posted @ 2022-11-25 14:28 焦耳|程 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 磁盘扩容 五分区 xfs_growfs -d /目录 df -h 有分区 growpart /dev/nvme1n1 1 xfs_growfs -d /目录 df -h 阅读全文
posted @ 2022-11-07 11:09 焦耳|程 阅读(21) 评论(0) 推荐(0) 编辑
摘要: vhost和server对应 vhost的匹配逻辑 在请求nginx时,判断请求属于哪个vhost,主要是server块中的listen和server_name两个字段决定 listen listen字段定义server响应的ip和端口,如果没有明确配置listen字段,默认监听0.0.0.0:80 阅读全文
posted @ 2022-10-27 17:31 焦耳|程 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Introduction Nginx is one of the most popular web servers in the world. It can successfully handle high loads with many concurrent client connections, 阅读全文
posted @ 2022-10-27 17:29 焦耳|程 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 前端发起这样的请求: http://192.168.0.2/test/aaa.txt proxy_pass可以分为以下12种情况 Scenario 1 ... location ^~ /test { ... proxy_pass http://127.0.0.1; } 代理后的实际URL为: htt 阅读全文
posted @ 2022-10-27 16:24 焦耳|程 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 不同阶段的顺序 init > init_worker > set > rewrite > access > content > header > body > log 同一个阶段下 不同context执行优先级 location > server > http 阅读全文
posted @ 2022-09-28 17:42 焦耳|程 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 方式1: 在writer层进行增加功能 var ( GOOGLE_APPLICATION_CREDENTIALS = "/gcs.json" ) type Writer struct { total int64 current int64 } //没用到 func (w *Writer) getFi 阅读全文
posted @ 2022-08-01 17:17 焦耳|程 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 简述 new() 和 make() 都是用于动态分配内存的内建函数 new()函数 官方文档如下: // The new built-in function allocates memory. The first argument is a type, // not a value, and the 阅读全文
posted @ 2022-01-27 16:26 焦耳|程 阅读(32) 评论(0) 推荐(0) 编辑