随笔分类 -  nginx

nginx http和https共存
摘要:server { listen 80 default backlog=2048; listen 443 ssl; server_name linuxyan.com; root /var/www/html; ssl_certificate /usr/local/Tengine/sslcrt/linux 阅读全文

posted @ 2019-04-01 16:34 dongruiha 阅读(1395) 评论(0) 推荐(0) 编辑

nginx client_body_buffer_size
摘要:http://www.bubuko.com/infodetail-1760832.html 上传文件过大时,nginx会报链接里面的warn,请求body写磁盘到缓存文件,导致性能降低,可适当调大该参数,以提高上传性能。 阅读全文

posted @ 2018-03-28 16:02 dongruiha 阅读(1209) 评论(0) 推荐(0) 编辑

nginx模块开发
摘要:http://cjhust.blog.163.com/blog/static/17582715720134721544759/ 阅读全文

posted @ 2018-03-28 15:20 dongruiha 阅读(111) 评论(0) 推荐(0) 编辑

centos添加nginx为系统服务
摘要:https://yq.aliyun.com/articles/7830 阅读全文

posted @ 2018-02-14 07:07 dongruiha 阅读(155) 评论(0) 推荐(0) 编辑

nginx利用fastcgi_cache模块缓存
摘要:nginx不仅有个大家很熟悉的缓存代理后端内容的proxy_cache,还有个被很多人忽视的fastcgi_cache。proxy_cache的作用是缓存后端服务器的内容,可能是任何内容,包括静态的和动态。fastcgi_cache的作用是缓存fastcgi生成的内容,很多情况是php生成的动态的内 阅读全文

posted @ 2018-01-28 06:53 dongruiha 阅读(482) 评论(0) 推荐(0) 编辑

nginx多个if条件并且查询
摘要:set $flag 0; if (!-e $request_filename){ set $flag "${flag}1"; } if ($uri ~* "^(.*)/15_74/$"){ set $flag "${flag}2"; } if ($flag = "012"){ rewrite ^/( 阅读全文

posted @ 2018-01-04 19:30 dongruiha 阅读(3371) 评论(0) 推荐(0) 编辑

Nginx模块fastcgi_cache的几个注意点
摘要:转自: http://www.cnxct.com/several-reminder-in-nginx-fastcgi_cache-and-php-session_cache_limiter/ 阅读全文

posted @ 2017-12-29 08:38 dongruiha 阅读(289) 评论(0) 推荐(0) 编辑

Nginx日志中的金矿
摘要:http://www.infoq.com/cn/articles/nignx-log-goldmine/ 阅读全文

posted @ 2017-07-13 16:06 dongruiha 阅读(138) 评论(0) 推荐(0) 编辑

配置 Nginx 错误页面优雅显示
摘要:[root@localhost ~]# cat /usr/local/nginx/conf/nginx.conf ...... http { location / { root html/www; index index.html index.htm; error_page 400 401 402 403 40... 阅读全文

posted @ 2017-07-10 15:41 dongruiha 阅读(1389) 评论(0) 推荐(0) 编辑

nginx的proxy_pass到$host的问题
摘要:做了反向代理后,由于代理服务器的nginx配置文件里有301跳转导致我的后端ajax程序有问题了,所以需要用到下面的规则过滤掉我的反向代理 if ( $uri !~ ^/bbs/(.*)/?$ ) { //判断如果不是我的服务 set $rule 1$rule; } if ( $uri ~* [/] 阅读全文

posted @ 2017-06-21 19:57 dongruiha 阅读(5933) 评论(0) 推荐(0) 编辑

nginx反向代理cookie相关
摘要:http://blog.csdn.net/xiansky2015/article/details/51674997 http://www.jianshu.com/p/aeed2a56a3eb 阅读全文

posted @ 2017-06-21 15:20 dongruiha 阅读(242) 评论(0) 推荐(0) 编辑

nginx配置静态资源关闭访问日志
摘要:location ~ .*\.(css|js|gif|png|jpg|jpeg|bmp|swf)$ { root $root_path; access_log off; } 阅读全文

posted @ 2017-06-14 11:45 dongruiha 阅读(2475) 评论(0) 推荐(0) 编辑

nginx优化之request_time 和upstream_response_time差别
摘要:1、request_time 官网描述:request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client 阅读全文

posted @ 2017-06-14 11:12 dongruiha 阅读(32323) 评论(2) 推荐(0) 编辑

nginx 重写URL尾部斜杠
摘要:1. 在URL结尾添加斜杠 rewrite ^(.*[^/])$ $1/ permanent; 2. 删除URL结尾的斜杠 rewrite ^/(.*)/$ /$1 permanent; 不过建议删除URL结尾的斜杠,会混乱搜索引擎的 参考 http://www.ttlsa.com/nginx/ng 阅读全文

posted @ 2017-06-06 11:53 dongruiha 阅读(4278) 评论(0) 推荐(0) 编辑

502的几种解决方案
摘要:1.FastCGI进程是否已经启动2.FastCGI worker进程数是否不够运行 netstat -anpo | grep “php-cgi” | wc -l 判断是否接近FastCGI进程,接近配置文件中设置的数值,表明worker进程数设置太少3.FastCGI执行时间过长根据实际情况调高以 阅读全文

posted @ 2017-05-19 17:42 dongruiha 阅读(501) 评论(0) 推荐(0) 编辑

Nginx中FastCGI配置优化
摘要:转自 http://www.cnblogs.com/yezhaohui/p/4377662.html 阅读全文

posted @ 2017-05-19 15:15 dongruiha 阅读(247) 评论(0) 推荐(0) 编辑

nginx rewrite正则子组最多匹配到$9
摘要:nginx rewrite正则匹配()匹配子组最多匹配到$9,就是从$0到$9 当需要匹配更多子组时,可通过变量来实现 if ($uri ~ ^/forum-15/sortid-74/(.*?)(lastpost|dateline)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9] 阅读全文

posted @ 2017-05-12 22:39 dongruiha 阅读(592) 评论(0) 推荐(0) 编辑

nginx虚拟主机添加
摘要:1. 进入 /usr/local/nginx/conf/vhost 目录, 创建虚拟主机配置文件 wbs.test.com.conf ({域名}.conf). 2.打开配置文件, 添加服务如下: log_format wbs.test.com '$remote_addr - $remote_user 阅读全文

posted @ 2017-05-03 10:05 dongruiha 阅读(292) 评论(0) 推荐(0) 编辑

导航