随笔分类 -  Nginx-Keepalived

摘要:user nginx; worker_processes auto; worker_processes 4; worker_cpu_affinity 0001 0010 0100 1000; worker_rlimit_nofile 65536; #error_log logs/error.log; 阅读全文
posted @ 2022-02-10 14:41 ascertain 阅读(93) 评论(0) 推荐(0) 编辑
摘要:(33条消息) nginx 交叉编译 ( 上 )_爱唠叨的老鱼的博客-CSDN博客_nginx 交叉编译 添加VIM语法支持: cp --no-dereference -r --preserve=all contrib/vim/* ~/.vim 查看man: man man/nginx.8 inst 阅读全文
posted @ 2021-10-19 17:43 ascertain 阅读(53) 评论(0) 推荐(0) 编辑
摘要:server_tokens off; add_header proxy_pass_header 可把后端Server透传到browser, 适用于代理 server_tokens build; Building nginx from Sources nginx编译选项 src/core/nginx. 阅读全文
posted @ 2021-10-19 17:21 ascertain 阅读(111) 评论(0) 推荐(0) 编辑
摘要:处理参数接口 location /getNameByGender { default_type ''; add_header Content-Type 'text/html; charset=utf-8'; # default_type 'text/html'; # charset utf-8; s 阅读全文
posted @ 2021-10-08 17:16 ascertain 阅读(40) 评论(0) 推荐(0) 编辑
摘要:Nginx的用户认证模块 对应系统资源的访问,我们往往需要限制谁能访问,谁不能访问。这块就是我们通常所说的认证部分,认证需要做的就是根据用户输入的用户名和密码来判定用户是否为合法用户,如果是则放行访问,如果不是则拒绝访问。 Nginx对应用户认证这块是通过ngx_http_auth_basic_mo 阅读全文
posted @ 2021-10-08 10:17 ascertain 阅读(990) 评论(0) 推荐(0) 编辑
摘要:Nginx制作下载站点 首先我们先要清楚什么是下载站点? 我们先来看一个网站http://nginx.org/download/这个我们刚开始学习Nginx的时候给大家看过这样的网站,该网站主要就是用来提供用户来下载相关资源的网站,就叫做下载网站。 如何制作一个下载站点: nginx使用的是模块ng 阅读全文
posted @ 2021-10-08 10:07 ascertain 阅读(147) 评论(0) 推荐(0) 编辑
摘要:以 .yaml 结尾的文件不缓存 以 .yaml 结尾的文件不走缓存 bypass 阅读全文
posted @ 2021-10-06 22:34 ascertain 阅读(39) 评论(0) 推荐(0) 编辑
摘要:Compile: yum install zlib-devel pcre-devel user bb; worker_processes auto; error_log logs/error.log notice; pid /var/run/nginx.pid; events { accept_mu 阅读全文
posted @ 2021-08-21 19:48 ascertain 阅读(26) 评论(0) 推荐(0) 编辑
摘要:日志 配置rsyslog 检测配置文件 检测编译选项 haproxy -vv Configuration # # Global settings # global # log是发给server的, 而不是本地的facility log 127.0.0.1 local2 log /dev/log lo 阅读全文
posted @ 2021-08-08 15:39 ascertain 阅读(48) 评论(0) 推荐(0) 编辑
摘要:(33条消息) nginx 交叉编译 ( 上 )_爱唠叨的老鱼的博客-CSDN博客_nginx 交叉编译 添加VIM语法支持: cp --no-dereference -r --preserve=all contrib/vim/* ~/.vim 查看man: man man/nginx.8 编译通用 阅读全文
posted @ 2020-12-31 15:50 ascertain 阅读(404) 评论(0) 推荐(0) 编辑
摘要:proxy_pass可以实现URL路径的替换,跟alias很像proxy_pass,不带 "/" 时,只代理域名,URI(包括query_string)不改变,URI直接附加到proxy_pass指定的域名proxy_pass,后跟 "/" 时,会把location匹配的部分完全删除后,附加于pro 阅读全文
posted @ 2020-12-06 13:30 ascertain 阅读(101) 评论(0) 推荐(0) 编辑
摘要:### 大坑 VIP 要设置成32位掩码,否则BACKUP无法ping通 ### broadcast 也不一样 man keepalived man keepalived.conf keepalived vrrp 虚拟路由器冗余协议 ( Virtual Router Redundancy Proto 阅读全文
posted @ 2020-12-05 15:48 ascertain 阅读(288) 评论(0) 推荐(0) 编辑
摘要:rewrite模块即ngx_http_rewrite_module模块,主要功能是改写请求URI,是Nginx默认安装的模块。rewrite模块会根据PCRE正则匹配重写URI,然后发起内部跳转再匹配location,或者直接做30x重定向返回客户端。 指令执行顺序 首先顺序执行server块中的r 阅读全文
posted @ 2020-12-04 14:33 ascertain 阅读(93) 评论(0) 推荐(0) 编辑
摘要:在开始处理一个http请求时,nginx会取出header头中的host,与nginx.conf中每个server的server_name进行匹配,以此决定到底由哪一个server块来处理这个请求。 server_name与host匹配优先级如下: 1、完全匹配 2、通配符在前的,如*.test.c 阅读全文
posted @ 2020-12-02 19:19 ascertain 阅读(348) 评论(0) 推荐(0) 编辑
摘要:新安装的nginx可以正常启动,但是查看状态,有个报错 nginx的启动一定的时间,systemd在/run/nginx.pid还未创建时,就读取,造成如此错误 解决办法: 修改nginx的Unit文件 修改前: [Unit] Description=The nginx HTTP and rever 阅读全文
posted @ 2020-10-15 17:56 ascertain 阅读(1203) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示