影响性能的指标
网络
网络是否丢包
系统
系统负载 内存等
服务
连接优化 请求优化
程序
处理速率 接口性能等
数据库
系统性能优化
设置文件句柄数
vim /etc/security/limits.conf
//针对root⽤用户
root soft nofile 65535
root ha ...
admin
2019-07-14 5:26 767℃ 0评论
3 喜欢
nginx默认不支持lua,需要额外安装luajit,建议使用openrestry
1.安装 openrestry
官方地址
./configure --prefix=/opt/openresty \
--with-luajit \
--with-pcre \
--with-pcre-jit
-- ...
admin
2019-07-14 5:08 749℃ 0评论
0 喜欢
php.ini优化
//打开php的安全模式,控制php执⾏行行危险函数, 默认是Off,改为On
sql.safe_mode = Off
//关闭php头部信息, 隐藏版本号, 默认是On,该为Off
expose_php = On
//错误信息输出控制
display_er ...
admin
2019-07-14 4:40 608℃ 0评论
0 喜欢
nginx的重定向主要依靠rewrite
使用场景
比如后台维护
比如 伪静态
比如seo优化等
配置方法
rewrite regex replacement [flag];
可以配置在server location if下
flag说明
last 停止rewrit ...
admin
2019-07-14 4:31 564℃ 0评论
0 喜欢
开启简单的缓存配置,只需要两个指令:proxy_cache_path和proxy_cache。
proxy_cache_path配置缓存的存放地址和其他的一些常用配置,
proxy_cache指令是为了启动缓存。
缓存配置
[root@proxy ~]# cat /etc/nginx/conf ...
admin
2019-07-14 4:20 580℃ 0评论
0 喜欢
代理相关头部信息配置
[root@Nginx ~]# vim /etc/nginx/proxy_params
proxy_redirect default;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $rem ...
admin
2019-07-12 23:34 507℃ 0评论
0 喜欢
Nginx 作为静态资源 Web 服务器器部署配置, 传输⾮非常的⾼高效, 常常⽤用于静态资源处理理, 请求, 动静 分离
静态资源类型
css js html
jpeg gif png
flv MP4
txt
相关配置参数
文件读取高效 sendfile
sendfile  ...
admin
2019-07-12 23:19 505℃ 0评论
0 喜欢
yum安装默认配置文件为/etc/nginx/nginx.conf
1.Main位于nginx.conf配置⽂文件的最⾼高层
2.Main层下可以有Event、HTTP层
3.HTTP层下⾯面有允许有多个Server层, ⽤用于对不不同的⽹网站做不不同的配置
4.Server层也允许有多个Lo ...
admin
2019-07-12 23:10 497℃ 0评论
0 喜欢
1.介绍
Nginx是一个开源的高性能的HTTP中间件
2.应用场景
静态文件处理
反向代理
负载均衡
缓存
安全防护
访问控制
3.安装
配置yum源
[root@localhost ~]# cat /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=n ...
admin
2019-07-12 18:58 539℃ 0评论
1 喜欢