Nginx
共 34 篇文章
nginx 反向代理 解析域名变成ipv6,关于DNS TTL的一点看法
nginx 反向代理 解析域名变成ipv6 Nginx服务配置文件中变量详解 关于DNS TTL的一点看法
2022-09-04 21:36 · Nginx
nginx优化之request_time 和upstream_response_time差别
http://blog.sina.com.cn/s/blog_4f9fc6e10102uxib.html error.log 中出现大量以下日志: 2013/11/13 11:26:10 [info] 18382#0: *73 client closed connection while waiting for request, client: 192.168.32.43, server: 0.0.0.0:80 请求量很小,一分钟也才3、4百个,远不到之前压力测试的阀值。上面的 client 很多 127.0.0.1 的,偶尔有个其他 IP 的。尝试过开关 keep-alive 均没能起到作…
2017-06-29 20:36 · Nginx
nginx map使用方法
http://www.ttlsa.com/nginx/using-nginx-map-method/ https://segmentfault.com/a/1190000005959724
2017-06-26 11:24 · Nginx
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx查看安装了哪些模块 http://www.blogjava.net/anchor110/articles/414176.html nginx: bind() to 0.0.0.0:443 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions) 原因是因为 nginx listen的443端口被占用导致无法成功启动nginx服务器。 https://blog.yoodb.com/yoodb/article/detail/1264
2017-06-26 11:11 · Nginx
Nginx 内置变量,细化规则,真实IP获取及限制连接请求
https://yq.aliyun.com/articles/44945 http://nginx.org/en/docs/http/ngx_http_limit_req_module.html http://nginx.org/en/docs/http/ngx_http_proxy_module.html#.24proxy_add_x_forwarded_for
2017-06-26 09:58 · Nginx
nginx启动,重启,关闭命令
http://www.cnblogs.com/derekchen/archive/2011/02/17/1957209.html
2017-06-23 16:49 · Nginx
Nginx常用负载均衡策略(接上一篇文章)
http://wiki.jikexueyuan.com/project/openresty/ngx/balancer.html https://moonbingbing.gitbooks.io/openresty-best-practices/content/ https://www.gitbook.com/book/moonbingbing/openresty-best-practices/details http://www.linuxidc.com/Linux/2015-02/113102.htm Nginx常用负载均衡策略(接上一篇文章)
2017-06-22 17:01 · Nginx
OpenResty初步使用
http://blog.csdn.net/yoara/article/details/52484268 LUA require 搜索路径指定方法 如果是一个 *.LUA 的文件, 里面用到了自己写的库, 或者第三方写的库, 但是你不想把它放到 lua 的安装目录里, 则在代码里面可以指定require搜索的路径 package.path = '/usr/local/share/lua/5.1/?.lua;/home/resty/?.lua;' --搜索lua模块 package.cpath = '/usr/local/lib/lua/5.1/?.so;' --搜索so模块 如果是要在 ngi…
2017-06-17 17:17 · Nginx
nginx location匹配规则
http://www.nginx.cn/115.html http://www.jb51.net/article/54854.htm https://www.web-tinker.com/article/21212.html nginx配置location总结及rewrite规则写法 http://www.cnblogs.com/lyongerr/p/nginx.html nginx 正则表达式
2017-06-16 14:57 · Nginx
使用Nginx+Lua(OpenResty)开发高性能Web应用
http://jinnianshilongnian.iteye.com/blog/2280928
2017-06-02 09:36 · Nginx
Nginx SSL+tomcat集群,request.getScheme() 取到https正确的协议
http://feitianbenyue.iteye.com/blog/2056357 https://zhidao.baidu.com/question/363454124300767572.html http://www.cnblogs.com/yihang/archive/2010/12/19/1910365.html http://www.linuxidc.com/Linux/2016-04/130692.htm
2017-05-27 09:39 · Nginx
Nginx做代理时X-Forwarded-For信息头的处理
http://blog.csdn.net/xybelieve1990/article/details/52932977 X-Forwarded-For 和 X-Real-IP 的区别? 一般来说,X-Forwarded-For是用于记录代理信息的,每经过一级代理(匿名代理除外),代理服务器都会把这次请求的来源IP追加在X-Forwarded-For中 来自4.4.4.4的一个请求,header包含这样一行 X-Forwarded-For: 1.1.1.1, 2.2.2.2, 3.3.3.3 代表 请求由1.1.1.1发出,经过三层代理,第一层是2.2.2.2,第二层是3.3.3.3,而本次请…
2017-05-25 23:02 · Nginx
Nginx实战系列之功能篇----后端节点健康检查
http://blog.csdn.net/moqiang02/article/details/42846221
2017-04-20 15:08 · Nginx
无法获取proxy_set_header的变量值
http://www.thinksaas.cn/ask/question/16504/ 注意:nginx对对header name的字符做了限制,默认 underscoresinheaders 为off,表示如果header name中包含下划线,则忽略掉。 解决办法: 配置中http部分 增加underscoresinheaders on; 配置 用减号-替代下划线符号_,避免这种变态问题。 http://www.cnblogs.com/princessd8251/articles/6267456.html
2017-04-15 11:26 · Nginx
nginx指令之——tcp_nodelay
指令tcp_nodelay作用于socket参数TCP_NODELAY。 在这之前,我们先说说nagle缓存算法,有些应用程序在网络通讯的时候会发送很少的字节,比如说一个字节,那么再加TCP协议本身,实际上发的要41个字节,这样的效率是很低的。这时候nagle算法就应运而生了,它将要发送的数据存放在缓存里,当积累到一定量或一定时间,再将它们发送出去。 这里TCP_NODELAY就是nagle启用与否的开关,所以下面的指令的效果就是禁用nagle算法,也即不缓存数据。 tcp_nodelay on; http://blog.csdn.net/wuyao721/article/details/7…
2017-04-15 11:11 · Nginx
Module ngx_http_limit_req_module
The ngx_http_limit_req_module module (0.7.21) is used to limit the request processing rate per a defined key, in particular, the processing rate of requests coming from a single IP address. The limitation is done using the “leaky bucket” method. Example Configuration http { limit_req_zone $binary_r…
2017-03-09 16:38 · Nginx
Ngnix中的fastcgi参数性能优化和解释
优化性能参数设置,在ngnix.conf中的http 层加上fastcgi参数如下: http { fastcgi_cache_path /usr/local/nginx/fastcgi_cache levels=1:2 keys_zone=TEST:10m inactive=5m; fastcgi_connect_timeout=300; fastcgi_send_timeout=300; fastcgi_buffer_size=64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_wri…
2017-03-08 09:27 · Nginx
Nginx中502和504错误详解
在使用Nginx时,经常会碰到502 Bad Gateway和504 Gateway Time-out错误,下面以Nginx+PHP-FPM来分析下这两种常见错误的原因和解决方案。 **1.502 Bad Gateway错误 ** 在php.ini和php-fpm.conf中分别有这样两个配置项:max_execution_time和request_terminate_timeout。 这两项都是用来配置一个PHP脚本的最大执行时间的。当超过这个时间时,PHP-FPM不只会终止脚本的执行, 还会终止执行脚本的Worker进程。所以Nginx会发现与自己通信的连接断掉了,就会返回给客户端502…
2017-03-08 08:32 · Nginx
Nginx服务器拒绝非GET方式请求保障安全性
upstream tomcat { ip_hash; server 192.168.2.187:8080; } location ~* /html { if ($request_method = PUT ) { return 403; } if ($request_method = DELETE ) { return 403; } if ($request_method = POST ) { return 403; } proxy_method GET; proxy_pass http://tomcat; } 当路径包含/html的时候,则代理到server后端进行请求数据。这里屏蔽了PUT…
2017-03-06 22:27 · Nginx