表示 进入内容 12
Displaying posts with tag: nginx-lua (reset)
nginx lua 与 autoindex

nginx-lua 不仅可以做接口, 还可以处理上层的输出 ( upstream outputs)。

比如下面的例子:

        location /sqlite {
                autoindex on;
                autoindex_localtime on;
        }

/sqlite目录开了autoindex,界面极简单,无任何css和js,想对其做出美化,无从下嘴。

效果图:

最近学习了nginx-lua,突然发现有可行方案了:

                body_filter_by_lua '
                        local b = ngx.arg[1]
                        --单双引号的问题。 双引号要用\\二个斜线转义。 单引号要用\一个斜线转义。 前提条件是body_filter_by_lua 后面用的是单引号。
                        ngx.arg[1] = …
[获取更多]
PHP vs Nginx-Lua vs html vs c-cgi

PHP vs Nginx-Lua vs html vs c-cgi

测试环境:
nginx 1.4.2 运行在 xxx.xxx.xxx.xxx(内网IP)
Intel(R) Xeon(R) CPU E5620 @ 2.40GHz

[root@yw-0-0 ~]# php -v
PHP 5.4.16 (cli) (built: Jun  7 2013 14:32:19) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with XCache v3.0.2, Copyright (c) 2005-2013, by mOo
    with XCache Optimizer v3.0.2, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.0.2, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.0.2, Copyright (c) 2005-2013, by mOo
 
php-fpm配置:
pm = dynamic
pm.max_children = 200
pm.start_servers = 100
pm.min_spare_servers = 100
pm.max_spare_servers = 150

nginx配置文件:

#user  nobody;
worker_processes  4;  
error_log  logs/error.log;
events {
        use epoll;
        worker_connections  5120;
}
http …
[获取更多]
表示 进入内容 12