随笔分类 -  Nginx

摘要:shell > yum -y install httpd-tools # 安装 htpasswd 工具 shell > cd /usr/local/nginx-1.10.2/conf shell > htpasswd -c pass.db wang # 创建认证用户 wang 并输入密码,添加用户时输入 htpasswd pass.db username shell > vim /us... 阅读全文
posted @ 2018-04-26 14:45 L狗哥 阅读(196) 评论(0) 推荐(0)
摘要:1、log_format 普通格式 2、log_format JSON 格式 3、指定日志格式 4、字段释义 字段 说明 阅读全文
posted @ 2017-08-02 21:19 L狗哥 阅读(8772) 评论(0) 推荐(0)
摘要:nginx默认是没有开启利用多核cpu的配置的。需要通过增加worker_cpu_affinity配置参数来充分利用多核cpu; 需要在nginx配置里添加 worker_processes 和 orker_cpu_affinity 两个配置; 1、假设服务器是 4核 CPU 开启 4个进程: wo 阅读全文
posted @ 2017-07-03 12:22 L狗哥 阅读(745) 评论(0) 推荐(0)
摘要:IP相关统计 统计IP访问量(独立ip访问数量) 查看某一时间段的IP访问量(4-5点) 查看访问最频繁的前100个IP 查看访问100次以上的IP 查询某个IP的详细访问情况,按访问频率排序 页面访问统计 查看访问最频的页面(TOP100) 查看访问最频的页面([排除php页面】(TOP100) 阅读全文
posted @ 2017-06-28 15:28 L狗哥 阅读(16764) 评论(0) 推荐(2)
摘要:正常配置 修改第1行,添加第5行配置,支持pathinfo 阅读全文
posted @ 2017-06-28 15:16 L狗哥 阅读(1928) 评论(0) 推荐(0)
摘要:1 server { 2 listen 80; 3 listen 443 ssl; 4 server_name default; 5 6 index index.html index.php; 7 root... 阅读全文
posted @ 2017-06-28 14:59 L狗哥 阅读(736) 评论(0) 推荐(0)
摘要:在server节点下添加 阅读全文
posted @ 2017-06-28 14:53 L狗哥 阅读(825) 评论(0) 推荐(0)
摘要:1 server { 2 listen 80; 3 server_name default; # 可以绑定域名 4 index index.html index.php; 5 6 root /www/html; # 代码访问路径 7 ... 阅读全文
posted @ 2017-06-28 14:51 L狗哥 阅读(264) 评论(0) 推荐(0)
摘要:1、在http节点下添加 upstream test { server 127.0.0.1:16010; server 127.0.0.1:16011;} 2、把server 节点下 location 里 proxy_pass 的配置修改为 http://upstream名称 即 http://te 阅读全文
posted @ 2017-06-28 14:42 L狗哥 阅读(233) 评论(0) 推荐(0)