openresty介绍,


一、工作原理
1.1 lamp工作原理:
http://blog.csdn.net/xinyflove/article/details/46618773
1.2.1 lnmp工作原理:
http://www.cnblogs.com/yanxinjiang/p/7552671.html
1.2.2 fastcgi、phpcgi、php-fpm?
https://segmentfault.com/q/1010000000256516
1.3 lamp及lnmp对比:
http://blog.csdn.net/huobobo124/article/details/52971479
1.4 各自优势?
1.5 我们的网站是怎么运行的?
lamp->.htaccress->thinkphp

 


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

nginx
include /usr/local/openresty/nginx/conf/rewrite/thinkphp.conf;

 

 


[root@web conf]# cat /root/oneinstack/config/laravel.conf
location / {
try_files $uri $uri/ /index.php?$query_string;
}

[root@web conf]# cat /usr/local/openresty/nginx/conf/rewrite/thinkphp.conf
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}


[root@web conf]# cat /root/oneinstack/config/wordpress.conf
location / {
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* ^/wp-content/uploads/.*\.php$ {
deny all;
}


二、其他产品
2.1 openresty
OpenResty (也称为 ngx_openresty)是一个全功能的 Web 应用服务器。它打包了标准的 Nginx 核心,很多的常用的第三方模块,以及它们的大多数依赖项。
通过众多进行良好设计的 Nginx 模块,OpenResty 有效地把 Nginx 服务器转变为一个强大的 Web 应用服务器,基于它开发人员可以使用 Lua 编程语言对 Nginx 核心以及现有的各种 Nginx C 模块进行脚本编程,构建出可以处理一万以上并发请求的极端高性能的 Web 应用。
OpenResty 致力于将你的服务器端应用完全运行于 Nginx 服务器中,充分利用 Nginx 的事件模型来进行非阻塞 I/O 通信。不仅仅是和 HTTP 客户端间的网络通信是非阻塞的,与MySQL、PostgreSQL、Memcached、以及 Redis 等众多远方后端之间的网络通信也是非阻塞的。
因为 OpenResty 软件包的维护者也是其中打包的许多 Nginx 模块的作者,所以 OpenResty 可以确保所包含的所有组件可以可靠地协同工作。
2.2 Tengine
Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。Tengine的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的Web平台。
2.3 Tengine和openresty对比:

Tengine 是一个 nginx 的 fork,而 ngx_openresty 是 nginx 的 bundle.

 

三、第三方模块
3.1 nginx模块:
http://tengine.taobao.org/book/module_development.html
nginx_upstream_check_module lua-nginx-module这个模块主要由前淘宝章亦春开发,并已经开源,代码在github上,现在他主要在做这方面的开源工作,并不断在更新完善,丰富的API,功能集非常强大,主要满足业务上的各种需求。
3.2 openresty第三方模块
lua第三方插件:
https://github.com/search?p=1&q=lua+resty&type=Repositories&utf8=%E2%9C%93
例子:http://jinnianshilongnian.iteye.com/blog/2187328/

 


四、openresty的优势

 

五、安装

 

六、参考文档
Tengine vs openresty
https://www.cnblogs.com/xd502djj/p/4310642.html

 

http://www.oschina.net/question/28_60461

 

http://blog.csdn.net/wangbin579/article/details/7287270

 

http://wiki.jikexueyuan.com/project/openresty/openresty/get_url_param.html

 

OpenResty
https://www.kancloud.cn/allanyu/openresty-best-practices/82606
https://moonbingbing.gitbooks.io/openresty-best-practices/content/


http://wiki.jikexueyuan.com/project/openresty-best-practice/cache.html
http://blog.csdn.net/kenkao/article/details/52093734


这个比较好
http://jinnianshilongnian.iteye.com/blog/2186448


nginx插件
短信攻击
百度爬虫重定向
服务器搭建
htaccress


OpenResty(nginx扩展)实现防cc攻击
https://www.centos.bz/2012/12/openresty-nginx-block-cc-attack-deploy/

nginx访问限制
http://outofmemory.cn/code-snippet/14396/nginx-and-lua


nginx lua redis 访问频率限制
http://www.ttlsa.com/nginx/nginx-lua-redis-access-frequency-limit/

禁止终端访问插件:


日志:
http://wiki.jikexueyuan.com/project/openresty/openresty/log_response.html

热转载代码:
http://wiki.jikexueyuan.com/project/openresty-best-practice/hot-load.html

 

相关内容

    暂无相关文章