1.sub_filter_module 过滤模块
2.连接限制 ab工具的使用
3.基于ip访问控制 http_access_module,基于rremote_addr来限制客户端;;对于代理过的ip有局限性,使用http_x_forwarded_for = p1,p2,p3,p4...来解决这一个问题;;;geo模块解决;;;http自定义变量传递
4.ip138
5.htt_auth_basic_module,权限控制模块,认证密码
进阶学习:05
1.静态资源服务器
2.代理服务
3.负载均衡
4.动态缓存
1.静态资源,html,css,js,jpg,png,flv,mp3,txt等类型文件
cdn技术
sendfile on,
tcp_nopush on,--把多个包整合后发出,必须sendfile 为on时才行
tcp_nodelay,没有延迟的推送,keeplive时才有用
gzip ,传输时压缩,减少网络消耗
gzip_comp_level level 压缩级别
压缩模块:http_gzip_static_module
nginx -t -c nginx.conf 检查文件配置是否正确
ngnix -s reload -c ngnix.conf 重载Nginx
浏览器的缓存:cache-control(客户端校验),etag,last-modified(服务端校验),没有更新时,返回304表示没有更新。
跨域访问:access-control-allow-origin
防盗链:1.基于http_referer设置防盗链
2.代理服务:
1.代理http,https,流媒体,邮件
proxy_pass url
proxy_redirect
proxy_set_header
proxy_connect_timeout
include的使用
3.负载均衡:
upstream
down
backup
ip_hash
轮询
url_hash 1.7.2以后版本
hash关键值
4.缓存服务:
proxy_cache
proxy_cache_path
高级内容:
1.动静分离
2.rewrite规则
pcre正则表达式匹配
flag: break,last,redirect,perment
二、高级模块
secure_link_module md5等安全校验
gaoip_module 区分国内国外
HTTPS服务
lua+nginx:实现高并发,
灰度发布:Nginx+lua+memcache
构架篇:
1.相同server_name多个虚拟主机优先级访问
2.location匹配优先级
3.try_files的使用 --适用于动静分离以及缓存
4.Nginx的alias与root的区别
5.用什么办法传递用户真实ip
二、系统性能优化
压测工具:ab netstat -luntp | grep java
文件句柄设置:有三个范围 worker_rlimit_nofile 35535
调节CPU亲和 cat /proc/cpuinfo | grep "" |sort|uiq|wc| -l
worker_cpu_affinity auto
事件驱动模型 events
三、安全篇