add engine

This commit is contained in:
leon.li 2015-12-03 14:32:54 +08:00
parent 139293b8f7
commit f0597ba7c2
1169 changed files with 486873 additions and 0 deletions

View file

@ -0,0 +1,20 @@
Names are in alphabetical order:
António P. P. Almeida (appa [at] perusio [dot] net)
Charles Chen (weiyue [at] taobao [dot] com)
Xiaojiang Chen (zhongsheng.cxj [at] taobao [dot] com)
Yunxing Chen (yunxing.cyx [at] taobao [dot] com)
Zhen Chen (gongyuan.cz [at] taobao [dot] com)
Shanyuan Gao (kangbo [at] taobao [dot] com)
Steve Peng (jinglong.pq [at] taobao [dot] com)
Feibo Li (lizi [at] taobao [dot] com)
Simon Liu (diaoliang [at] taobao [dot] com)
Yang Tian (lieyuan [at] taobao [dot] com)
Xiaozhe "chaoslawful" Wang (chaoslawful [at] gmail [dot] com)
Xiaowei Wu (yixiao.wxw [at] taobao [dot] com)
Junmin Xiong (xiongjunmin.pt [at] taobao [dot] com)
Zhuo Yuan (yuanzhuo.pt [at] taobao [dot] com)
Weibin Yao (wenjing.ywb [at] taobao [dot] com)
Zhang "agentzh" Yichun (agentzh [at] gmail [dot] com)
Lanshun Zhou (zls.sogou [at] gmail [dot] com)
Joshua Zhu (shudu [at] taobao [dot] com)

6673
Dengine/tengine/CHANGES Normal file

File diff suppressed because it is too large Load diff

260
Dengine/tengine/CHANGES.cn Normal file
View file

@ -0,0 +1,260 @@
Tengine 2.1.1 [2015-08-12]
* Feature: 支持动态upstream更新 [yzprofile]
* Feature: 增强ngx_http_reqstat_module模块 [cfsego]
* Feature: 增加ssl_verify_client_exception指令 [InfoHunter]
* Change: 降低解析配置的内存消耗 [ilexshen]
* Change: trim模块增加$trim_bytes和$trim_original_bytes [taoyuanyuan]
* Change: 升级debian二进制包的版本到2.1.0 [PeterDaveHello]
* Change: 将ngx_http_spdy_module模块集成到travis-ci自动编译 [chobits]
* Change: 更新SPDY/3.1 [chobits]
* Change: SPDY时关闭proxy_request_buffering指令 [chobits]
* Change: 增加编译选项支持设置linker [tanguofu]
* Bugfix: 修复SPDY的Backport bug [nginx official, ym]
* Bugfix: SPDY和SSL模块一起编译时报错 [ym]
* Bugfix: 修复打开reuseport的bug [monadbobo]
Tengine 2.1.0 [2014-12-19]
* Feature: 支持SO_REUSEPORT选项以提升CPU负载均衡性和性能 [monadbobo]
* Feature: 支持动态解析upstream中出现的域名 [InfoHunter]
* Feature: rewrite指令支持重定向到命名location [yzprofile]
* Feature: image_filter指令支持crop_keepx和crop_keepy参数 [Lax]
* Feature: consistent_hash模块和session_sticky模块支持SSL会话保持 [dinic]
* Feature: 支持travis-ci.org自动编译 [Jamyn]
* Feature: 健康检查模块支持FASTCGI检查 [yzprofile]
* Feature: 增强sysguard模块的功能 [InfoHunter]
* Feature: 新增变量$normalized_request得到规范化的请求 [yunkai]
* Feature: dso的include指令支持通配符 [monadbobo]
* Feature: 新增gzip_clear_etag指令 [taoyuanyuan]
* Feature: 为log_escape指令添加unprintable参数 [skoo87]
* Change: 合并nginx-1.6.2版本的修改 [cfsego, taoyuanyuan, chobits]
* Change: round robin负载均衡算法随机选择某个源站作为循环起点 [taoyuanyuan]
* Change: 对共享内存中的碎片进行优化 [chobits]
* Bugfix: SPDY/3关闭连接时去掉drop标志 [chobits]
* Bugfix: 修复SPDY/3出现连接泄漏的问题 [chobits]
* Bugfix: 修复limit_req模块将长度超过255个字符的key截断的问题 [chobits]
* Bugfix: 解析/etc/resolv.conf中的IPv6地址出错 [lifeibo]
* Bugfix: 通过红黑树查找到错误的upstream [taoyuanyuan]
Tengine 2.0.3 [2014-05-30]
* Feature: 支持按指定维度(域名url等)收集Tengine运行状态 [cfsego]
* Feature: 支持debian、ubuntu打包 [betetrpm, szepeviktor]
* Change: 合并nginx-1.4.7的修改 [chobits]
* Change: 使用红黑树优化upstream配置解析和查找 [SarahWang]
* Change: 更新版权信息
* Bugfix: 修复session-sticky模块相关问题 [dinic]
* Bugfix: 修复DSO编译和安装模块的问题 [cfsego]
* Bugfix: 修复spdy相关问题 [chobits]
Tengine 2.0.2 [2014-03-28]
* Bugfix: 在读事件处理完后继续发送SPDY数据 [chobits]
* Bugfix: CVE-2014-0133以及CVE-2014-0088 [chobits]
Tengine 2.0.1 [2014-03-06]
* Feature: 请求体不缓存的机制支持chunked输入 [yaoweibin]
* Feature: trim模块支持更多规则支持根据变量启用 [taoyuanyuan]
* Feature: 利用/etc/resolv.conf自动配置resolver [lifeibo, yaoweibin]
* Feature: 增加$ascii_变量前缀可以生成任意ASCII字符 [yzprofile]
* Feature: 增加"image_filter_crop_offset"指令 [lax]
* Change: 合并截至nginx-1.4.6版本的所有修改 [chobits, cfsego]
* Bugfix: 修正使用长连接进行健康检查时报错的问题 [lilbedwin]
* Bugfix: 修正使用WebSocket时nginx崩溃的问题
http://trac.nginx.org/nginx/ticket/503 [Hao Chen]
* Bugfix: 减少nginx处理大文件时的内存消耗 [cfsego]
* Bugfix: 在未设置URI时禁用跳转到named locations的重定向
Tengine 2.0.0 [2014-01-08]
* Feature: 增强DSO模块编译动态模块不再依赖原始编译环境 [monadbobo]
* Feature: 支持SPDY v3协议自动检测同一端口的SPDY请求和HTTP请求 [lilbedwin、chobits]
* Feature: 支持设置proxy、memcached、fastcgi、scgi、uwsgi在后端失败时的重试次数 [supertcy]
* Feature: tfs模块在RcServer心跳时汇报访问统计 [zhcn381]
* Feature: if指令支持比较数值大小'>'、'<'、'>='、'<=' [flygoast]
* Feature: 健康检查模块支持长连接检查,增加"check_keepalive_requests"指令 [lilbedwin]
* Feature: trim模块支持SSI和ESI的注释 [taoyuanyuan]
* Feature: expires_by_types指令支持使用通配符例如'text/*'匹配子类型 [zhcn381]
* Feature: 增加$base64_decode_变量前缀支持计算指定变量的base64解压结果 [yzprofile]
* Feature: 增加$md5_encode_变量前缀支持计算指定变量的md5哈希 [yzprofile]
* Feature: 增加$time_http变量支持按http格式输出当前时间 [flygoast]
* Feature: 增加$full_request变量取得原始的请求url包括协议类型和域名 [yzprofile]
* Feature: 增加$escape_uri_变量前缀支持对指定变量进行url转义 [yzprofile]
* Feature: 增加$raw_uri变量支持取得不含参数的原始uri [flygoast]
* Feature: 支持按微秒记录子请求的请求时间 [jinglong]
* Feature: 增加API支持对url进行base64编码 [lilbedwin]
* Change: 合并nginx-1.4.4版本的修改 [cfsego]
* Change: 修改stub_status模块不对子请求进行统计 [jinglong]
* Bugfix: 修正footer模块不处理含有Content-Encoding头的响应 [yaoweibin]
* Bugfix: 修正client_body_postpone_size指令设置为0时出现的问题 [yaoweibin]
* Bugfix: 修正Lua模块编译时出现警告 [diwayou]
Tengine-1.5.2 [2013-11-22]
* Security: 修复CVE-2013-4547安全漏洞
* Bugfix: 修复limit_req模块中nodelay无效的问题 [cfsego]
* Bugfix: 修复trim模块在替换javascript异常的问题 [taoyuanyuan]
Tengine-1.5.1 [2013-08-29]
* Feature: 增加retry_cached_connection指令可以关闭对后端长连接的无条件重试 [yaoweibin]
* Feature: sysguard模块的sysguard_load指令中加入ncpu参数 [yzprofile]
* Bugfix修复referer模块在https协议时正则匹配失效的问题 [lilbedwin]
* Bugfix修复trim模块可能产生0长度块的问题 [taoyuanyuan]
* Bugfix修复在使用--without-dso选项时出现的编译错误 [zhuzhaoyuan]
* Bugfix修复两个编译警告 [zzjin, diwayou]
Tengine-1.5.0 [2013-07-31]
* Feature: 增加DSO动态模块加载兼容性校验机制 [monadbobo]
* Feature: 增加了请求体不缓存到磁盘的机制HTTP代理和FastCGI模块收到部分请求体即可以转发给后端服务器 [yaoweibin]
* Feature: 增加了trim模块该模块可以自动删除HTML页面中无意义的空白符和注释减小页面的大小 [taoyuanyuan]
* Feature: 加入accept filter机制支持在连接接收以后进行过滤处理 [yzprofile]
* Feature: 现在server_tag指令可以改变默认错误页面的服务器标识 [zhuzhaoyuan]
* Bugfix修复access_log指令中buffer参数失效的问题 [cfsego]
* Bugfix修复session_sticky模块在某些情况下没有发出session cookie的问题 [dinic]
Tengine-1.4.6 [2013-05-14]
* Bugfix合并nginx-1.2.9的更新修正CVE-2013-2070带来的安全问题。该安全问题在1.4.0以后开始出现 [yaoweibin]
Tengine-1.4.5 [2013-05-01]
* Feature增加一致性hash模块可以为后端服务器提供一致性hash的负载均衡方法 [dinic]
* Feature通过keepalive_timeout指令可以设置后端keepalive连接的超时时间 [jinglong]
* Feature加入所有模块静态编译或者所有模块动态编译的编译选项 [monadbobo]
* Change更新Lua模块至0.7.19 [jinglong]
* Change合并Nginx-1.2.8的更新 [yaoweibin]
* Bugfix修正syslog和upstream_check模块在GCC-4.4.5上的编译警告 [magicbear]
Tengine-1.4.4 [2013-03-21]
* Feature增加session_sticky模块可以为客户端和后端服务器提供会话保持功能 [dinic]
* Featuresysguard模块增加空闲内存监控功能 [lifeibo]
* Featuregeoip模块增加对地区数据库的支持 [jasonlfunk]
* Featurelog_empty_request指令增加对408响应的空请求支持 [yaoweibin]
* Change合并Nginx-1.2.5至Nginx-1.2.7的更新 [cfsego]
* Change默认关闭CPU亲缘性 [cfsego]
* Bugfix修正在Solaris 11上sysguard和upstream_check模块编译出错的问题 [lifeibo, yaoweibin]
* Bugfix修正TFS模块返回值可能错误的问题 [zhcn381]
* Bugfix: 修正TFS模块上传大文件可能出错的问题 [zhcn381]
Tengine-1.4.3 [2013-1-21]
* Feature增加TFS模块可以通过RESTful接口与TFS分布式文件系统通信 [zhcn381, monadbobo]
* Feature增加$sent_cookie_XXX系列变量可以获取响应中Set-Cookie头的cookie值 [skoo87]
* Featuresyslog指令的发送地址支持域名 [cfsego]
* Changeupstream块中的server指令增加id属性 [yaoweibin]
* BugfixDSO模块修正reload时可能失败的问题 [monadbobo]
* Bugfix修复upstream_check模块当超时时间长于检查时间可能导致段错误的问题 [yaoweibin]
* Bugfix修复user_agent模块在请求缺少User-Agent头会段错误的问题 [dinic]
* Bugfix修复sysguard模块在Mac OS下面不能工作的问题 [lizi]
Tengine-1.4.2 [2012-11-22]
* Feature增加--dso-tool-path配置选项可以选择dso_tool脚本的安装目录 [monadbobo]
* Feature增加$unix_time变量表示当前的时间戳秒数 [yaoweibin]
* FeatureMakefile中增加test命令以便运行测试用例 [yaoweibin]
* Featuresysguard模块可在location里面配置 [lifeibo]
* Change合并Nginx-1.2.4和Nginx-1.2.5的更新 [zhuzhaoyuan]
* Change增加对input_filter函数返回值的检查防止第三方模块调用出错 [cfsego]
* Bugfix修复limit_req指令不能使用4个参数的问题感谢LazyZhu的报告 [monadbobo]
* Bugfix修复在cygwin下面编译sysinfo文件出错的问题感谢Cao Peiran的报告 [lifeibo]
* Bugfix修复user-agent模块安装时需要拷贝browsers配置文件的问题感谢Jianbin Xiao的报告 [monadbobo]
* Bugfix修复DSO模块RPM打包安装目录出错的问题感谢Jianbin Xiao和Ren Xiaolei的报告 [monadbobo]
Tengine-1.4.1 [2012-10-10]
* Feature 添加jemalloc库的支持 [fanjizhao]
* Feature 加入$dollar变量, 它的值就是美元符号 [zhuzhaoyuan]
* Feature 为worker_cpu_affinity指令加入off选项 [cfsego]
* Change 当工作进程异常退出以后新进程不会绑定CPU亲缘性 [cfsego]
* Bugfix: 修正在Mac OS操作系统下Lua模块与LuaJIT动态编译时出现的错误 [monadbobo]
* Bugfix: 修正动态编译第三方filter模块时出现的模块执行顺序错误 [monadbobo]
Tengine-1.4.0 [2012-09-05]
* Feature 增加动态模块加载支持DSO要添加一个模块不再需要重新编译tengine了 [monadbobo]
* Feature 更新Lua模块到最新的稳定版本 [chaoslawful, agentzh, jinglong]
* Feature 为健康检查模块增加json和csv格式的输出 [yaoweibin]
* Feature 增加log_empty_request指令可以用来关掉空请求日志——那些连接了但没发数据的连接 [zhuzhaoyuan]
* Feature 给concat模块增加concat_delimiter指令设置文件间的间隔内容 [dinic]
* Feature 增加concat_ignore_file_error指令并允许concat的语法更宽松 [dinic]
* Feature 给error_page指令增加default选项以恢复所有的错误页面为默认值 [jinglong]
* Feature 给proc模块增加priority指令可设置proc进程的优先级 [yzprofile]
* Feature 给proc模块增加delay_start指令可设置延迟加载时间 [yzprofile]
* Change 集成最新nginx稳定版本1.2.3的内容 [zhuzhaoyuan]
* Bugfix 修正一个geo模块设了range但是没有默认值时产生的段错误问题 [yzprofile]
* Bugfix 修正一个proc模块的空指针问题 [yzprofile]
* Bugfix 修正一个健康检查模块的socket泄漏问题 [yaoweibin]
* Bugfix 修正limit_req模块的若干问题 [monadbobo]
* Bugfix 修正若干日志输出类型错误的问题 [yaoweibin]
* Bugfix 修正perl模块和proc一起打开的一个编译错误 [yzprofile]
Tengine-1.3.0 [2012-05-25]
* Feature加入Lua模块可以在配置中使用Lua语言 [chaoslawful, agentzh]
* Feature加入procs模块可以更方便的开启独立进程 [yzprofile]
* Changeuser_agent模块中参数nongreedy改名为greedy [dinic]
* Bugfix修复syslog指令中因为指针未初始化引起的段错误 [cfsego]
* Bugfix修复syslog指令打开--with-ipv6选项引起的编译错误 [cfsego]
Tengine-1.2.5 [2012-05-09]
* Feature增加upstream_check模块对后端服务器做主动健康检查以自动的下线失效的服务器 [yaoweibin]
* Feature允许syslog输出日志时指定程序的标识program identifier [cfsego]
* Change合并nginx-1.0.14至nginx-1.0.15之间的修改 [zhuzhaoyuan]
* Change将accept_mutex_delay的默认值从500毫秒更改为100毫秒以提高性能 [zhuzhaoyuan]
* Bugfix修复syslog的一个在后端服务器连接不上导致端错误的bug [cfsego]
* Bugfix修复access_log可能和buffer参数冲突的bug [cfsego]
Tengine-1.2.4 [2012-03-30]
* Feature增加user_agent模块 [dinic]
* Feature增加log_escape指令 [agentzh, skoo87]
* Change合并nginx-1.0.12至nginx-1.0.14之间的修改 [zhuzhaoyuan]
* Bugfix修复limit_req模块的一个bug [liseen.wan]
* Bugfix修复subrequest的一个bug [lifeibo]
Tengine-1.2.3 [2012-02-27]
* Feature增加request_time_cache指令用来控制是否启用精确的响应时间 [yzprofile]
* Feature增加slice模块获得一个文件的一个片段可以添加头和尾 [zhuzhaoyuan]
* Change合并nginx-1.0.11至nginx-1.0.12之间的修改 [zhuzhaoyuan]
* Change去掉无用的user-agent判断 [zhuzhaoyuan]
* Bugfix修复upstream中的一个process_header的bug [lifeibo]
* Bugfix修复expires_by_types的一个bug [lifeibo]
Tengine-1.2.2 [2012-01-11]
* Feature增加input body filter机制 [cfsego]
* Feature对mail部分支持ssl的dialog [cfsego]
* Change合并进nginx-1.0.10至nginx-1.0.11之间的修改 [zhuzhaoyuan]
* Change默认关掉lingering_close [zhuzhaoyuan]
* Bugfix修正日志管道时的bug [cfsego]
* Bugfix修正limit_req的forbid_action无效的bug [monadbobo]
* Bugfix 修正backtrace模块backtrace_max_stack_size的问题 [monadbobo]
* Bugfix修正内容为空footer模块输出不正确的问题 [dinic]
* Bugfix修正syslog时hostname最后一个字母丢失的问题 [cfsego]
Tengine-1.2.1 [2011-12-06]
* Bugfix修正默认错误日志和访问日志不存在时启动报错的bug [yzprofile]
Tengine-1.2.0 [2011-11-29]
* Feature错误日志和访问日志支持输出到syslog [cfsego]
* Feature错误日志和访问日志支持输出到管道的方式 [cfsego]
* Feature增加realloc相关的API包括内存池 [gongyuan]
* FeatureHTTP日志支持更多的有关时间的变量 [skoo87]
* Feature增加backtrace模块在coredump时输出调用栈 [monadbobo]
* Featurelimit_req功能增强增加白名单可以有多个条件 [monadbobo]
* Featuresysguard模块load和内存占用偏高时进行保护 [lifeibo]
* Feature增加APIngx_http_header_in/ngx_http_header_out用来取输入和输出的HTTP头信息 [lifeibo]
* Feature增加两个变量$request_time_msec和$request_time_usec分别是相应时间的毫秒表示和微秒表示 [jinglong]
* Feature增加footer模块可以在HTML末尾添加内容支持变量 [yunxing]
* Feature增加变量$conn_requests记录当前request是连接上的第几个 [lieyuan]
* Feature增加变量$host_comment插入注释功能以说明哪台机器产生的请求 [yunxing]
* Feature访问日志增加ratio参数抽样功能可以减少日志的记录量 [cfsego]
* Feature增加server_admin、server_info指令出错信息提示更友好的错误页面 [lieyuan]
* Feature增加命令行参数-d把配置文件的内容全部打印出来 [piaoling]
* Feature增加指令expires_by_types可以根据types来设置超时 [lifeibo]
* Feature增加命令行参数-l可以列出所有的directives [dinic]
* Feature增加ngx_atoll的api可以将字符串转换成64位整数支持32位与64位系统 [lifeibo]
* Featurestatus line302405现在采用RFC 2616的标准 [zhuzhaoyuan]
* Featurengx_escape_uri/ngx_unescape_uri现在支持PHP/Java的编解码格式 [zhuzhaoyuan]
* Feature配置文件include多个文件时按照字母顺序进行包含 [zhuzhaoyuan]
* Featureerror_page指令增强支持default可以把把上一级设置的error_page重新设定 [zhuzhaoyuan]
* Feature增加对每请求的响应时间的统计cactitsar [jinglong]
* Feature增加指令server_tag更强大的控制HTTP服务器的Server头是否显示以及内容是什么 [jinglong]
* Feature自动调整worker进程的数目和绑定CPU亲缘性 [cfsego]
* Feature增加指令ssl_pass_phrase_dialogSSL对key进行加密功能 [cfsego]
* Feature增加-s选项的start参数 [zhuzhaoyuan]
* Feature增加-m选项可以把已编译的模块列出来 [zhuzhaoyuan]
* Change更改msie_padding的默认值为关掉 [zhuzhaoyuan]
* Bugfix修复open_file_cache在已经检测到缓存文件发生变化后仍然返回过时的文件状态信息的问题 [cfsego]
* Bugfix修复upsteam在subrequest in memory且keepalive时会导致timeout的bug [lifeibo]
* Bugfix修复$sent_http_connection和$sent_http_keep_alive记录不正确的问题 [zhongsheng]
* Bugfix修正error_page不能发现重复的code的问题不能正常继承上一级设置的问题 [zhuzhaoyuan]
* Bugfix修正Nginx在处理FastCGI时有重复HTTP头会core dump的bug [monadbobo]
* Bugfix修正Nginx对CPU亲缘性设置不正确的bug [cfsego]

6780
Dengine/tengine/CHANGES.ru Normal file

File diff suppressed because it is too large Load diff

644
Dengine/tengine/CHANGES.te Normal file
View file

@ -0,0 +1,644 @@
Changes with Tengine 2.1.1 12 Aug 2015
*) Feature: support for dynamic upstream update. (yzprofile)
*) Feature: enchanced ngx_http_reqstat_module. (cfsego)
*) Feature: added ssl_verify_client_exception directive. (InfoHunter)
*) Change: Reduced memory usage while parsing configuration. (ilexshen)
*) Change: added $trim_bytes and $trim_original_bytes. (taoyuanyuan)
*) Change: upgrade debian package to 2.1.0 (PeterDaveHello)
*) Change: support for auto compile for ngx_http_spdy_module. (chobits)
*) Change: updated SPDY/3.1. (chobits)
*) Change: disabled 'proxy_request_buffering' for SPDY. (chobits)
*) Change: added configue options to support set linker. (tanguofu)
*) Bugfix: fixed Backport bug of SPDY (nginx official, ym)
*) Bugfix: fixed compile error with SSL. (ym)
*) Bugfix: fixed bug of reuseport. (monadbobo)
Changes with Tengine 2.1.0 19 Dec 2014
*) Feature: support the SO_REUSEPORT option, to improve performance on
multicore systems. (monadbobo)
*) Feature: support for resolving upstream domain names on the fly.
(InfoHunter)
*) Feature: support for rewriting to named locations. (yzprofile)
*) Feature: added two parameters 'crop_keepx' and 'crop_keepy' to the
directive 'image_filter'. (Lax)
*) Feature: support for saving SSL sessions in consistent_hash module and
session_sticky module. (dinic)
*) Feature: support for compiling Tengine automatically in travis-ci.org.
(Jamyn)
*) Feature: support for FastCGI health check. (yzprofile)
*) Feature: enhanced sysguard module. (InfoHunter)
*) Feature: added a variable '$normalized_request', to get normalized
request URIs. (yunkai)
*) Feature: added wildcard support for 'include' directive in 'dso' block.
(monadbobo)
*) Feature: added the 'gzip_clear_etag' directive. (taoyuanyuan)
*) Feature: added the 'unprintable' parameter to the 'log_escape' directive.
(skoo87)
*) Change: merged changes from nginx-1.6.2. (cfsego, taoyuanyuan, chobits)
*) Change: now the order of servers in an upstream are random when
initialized. (taoyuanyuan)
*) Change: slab allocator free pages defragmentation. (chobits)
*) Bugfix: SPDY/3 dropped the "delayed" flag when finalizing connection.
(chobits)
*) Bugfix: fixed SPDY/3 connection leak. (chobits)
*) Bugfix: now don't truncate value of key to 255 bytes in limit_req module.
(chobits)
*) Bugfix: failed to parse /etc/resolv.conf with IPv6 addresses. (lifeibo)
*) Bugfix: upstream rbtree bugfix. (taoyuanyuan)
Changes with Tengine 2.0.3 30 May 2014
*) Feature: added support for collecting the running status of Tengine
according to specific key (domain, url, etc). (cfsego)
*) Feature: added support for generating package of debian/ubuntu
format(*.deb). (betetrpm, szepeviktmr)
*) Change: merged changes between nginx-1.4.6 and nginx-1.4.7. (chobits)
*) Change: optimized the parsing and searching strategy of upstream by
using rbtree. (SarahWang)
*) Change: updated the copyright.
*) Bugfix: fixed bugs of session-sticky module. (dinic)
*) Bugfix: fixed compiling and installing issues of DSO modules. (cfsego)
*) Bugfix: fixed bugs of SPDY protocol. (chobits)
Changes with Tengine 2.0.2 28 March 2014
*) Bugfix: send output queue after processing of read event in SPDY. (chobits)
*) Bugfix: CVE-2014-0133 and CVE-2014-0088. (chobits)
Changes with Tengine 2.0.1 06 March 2014
*) Feature: now non-buffering request body mechanism supports chunked input.
(yaoweibin)
*) Feature: trim module added more rules, and now can be enabled according
to variables. (taoyuanyuan)
*) Feature: resolver can be configured automatically from /etc/resolv.conf.
(lifeibo, yaoweibin)
*) Feature: added variables starting with "$ascii_", which can represent
arbitrary ASCII characters. (yzprofile)
*) Feature: added a new directive "image_filter_crop_offset". (lax)
*) Change: merged changes between nginx-1.4.4 and nginx-1.4.6. (chobits, cfsego)
*) Bugfix: upstream health check module failed occasionally when using
keep-alive connections. (lilbedwin)
*) Bugfix: nginx crashed when upstream rejected nginx WebSocket connection.
http://trac.nginx.org/nginx/ticket/503 (Hao Chen)
*) Bugfix: reduce nginx memory consumption when processing large files.
(cfsego)
*) Bugfix: disabled redirects to named locations if URI is not set.
Changes with Tengine 2.0.0 08 Jan 2014
*) Feature: now DSO module does not need the original source code or
compiler options when compiling a new module. (monadbobo)
*) Feature: added support for SPDY v3, and SPDY/HTTP servers can listen on
the same port. (lilbedwin、chobits)
*) Feature: added support for setting retries for upstream servers (proxy,
memcached, fastcgi, scgi, uwsgi). (supertcy)
*) Feature: now tfs module can report access status to rcs while keepalive.
(zhcn381)
*) Feature: now the directive "if" supports ">", "<", ">=", "<=" operators
for numeric comparison. (flygoast)
*) Feature: now upstream health check module uses keep-alive connections.
added a new directive "check_keepalive_requests". (lilbedwin)
*) Feature: now trim module can handle SSI and ESI comments properly.
(taoyuanyuan)
*) Feature: now directive "expires_by_types" supports wildcard such as
"text/*". (zhcn381)
*) Feature: added variables starting with "$base64_decode_" to encode
variables in base64. (yzprofile)
*) Feature: added variables starting with "$md5_encode_" to encode variables
in md5. (yzprofile)
*) Feature: added a variable "$time_http" to get the current HTTP time.
(flygoast)
*) Feature: added a variable "$full_request" to get the original request
URL with scheme and host. (yzprofile)
*) Feature: added variables starting with "$escape_uri_" to escape variables
into formal URL syntax. (yzprofile)
*) Feature: added a variable "$raw_uri" to get the original URI without
arguments. (flygoast)
*) Feature: added support for logging subrequests in nanoseconds. (jinglong)
*) Feature: added a new API function to encode URL into base64. (lilbedwin)
*) Change: merged changes between nginx-1.2.9 and nginx-1.4.4. (cfsego)
*) Change: now stub_status module does not log subrequests. (jinglong)
*) Bugfix: fixed a bug in footer module when reading a response with
a "Content-Encoding" header. (yaoweibin)
*) Bugfix: fixed a bug when "client_body_postpone_size" is set to 0.
(yaoweibin)
*) Bugfix: fixed a compilation warning of Lua module. (diwayou)
Changes with Tengine 1.5.2 22 Nov 2013
*) Security: a character following an unescaped space in a request line
was handled incorrectly (CVE-2013-4547); the bug had appeared in
0.8.41.
Thanks to Ivan Fratric of the Google Security Team.
*) Bugfix: fix a bug that 'nodelay' might be ignored in limit_req module.
(cfsego)
*) Bugfix: fix a bug in trim module when processing JavaScript comment.
(taoyuanyuan)
Changes with Tengine 1.5.1 29 Aug 2013
*) Feature: added the directive 'retry_cached_connection' which could
disable unconditional retries with a cached backend connection.
(yaoweibin)
*) Feature: added the argument of 'ncpu' to 'sysguard_load' directive.
(yzprofile)
*) Bugfix: fixed a bug in referer module that regex rules might be
invalid with https requests. (lilbedwin)
*) Bugfix: fixed a bug that the trim module might send a zero-size
buffer. (taoyuanyuan)
*) Bugfix: fixed a compile error when using the configure option
'--without-dso'. (zhuzhaoyuan)
*) Bugfix: fixed two compile warnings. (zzjin, diwayou)
Changes with Tengine 1.5.0 31 Jul 2013
*) Feature: added ABI compatibility verification for DSO modules.
(monadbobo)
*) Feature: added non-buffering request body mechanism. Now the http proxy
and fastcgi module can send requests to backend servers when it receives
part of a request body. (yaoweibin)
*) Feature: added trim module which can remove unnecessary white spaces and
comments to reduce the size of a page. (taoyuanyuan)
*) Feature: added the accept filter mechanism which supports to do some
filter processing after accepting a new connection. (yzprofile)
*) Feature: Now the server banner in a default error page can be replaced
by the string specified in server_tag. (zhuzhaoyuan)
*) Bugfix: fixed the bug of the 'buffer' argument might be ignored in the
'access_log' directive. (cfsego)
*) Bugfix: fixed the session_sticky module didn't issue the session cookie
in the direct mode. (dinic)
Changes with Tengine 1.4.6 14 May 2013
*) Bugfix: merged the changes of Nginx-1.2.9 and fixed the security problem
CVE-2013-2070. This bug had appeared in 1.4.0. (yaoweibin)
Changes with Tengine 1.4.5 1 May 2013
*) Feature: added the consistent_hash module which dispatches requests
to upstream servers based on consistent hashing algorithm of a
variable specified. (dinic)
*) Feature: added the "keepalive_timeout" directive to set timeout for
the upstream keepalive connections. (jinglong)
*) Feature: now the configure script supports compilation of all modules
to be shared or static. (monadbobo)
*) Change: updated the Lua module to 0.7.19. (jinglong)
*) Change: merged the changes of Nginx-1.2.8. (yaoweibin)
*) Bugfix: fixed the compile warnings of syslog and upstream_check
modules in GCC-4.4.5. (magicbear)
Changes with Tengine 1.4.4 21 Mar 2013
*) Feature: added the session_sticky module by using which one client
can be always served by the same upstream server. (dinic)
*) Feature: now the sysguard module can protect the server based on
the amount of free memory. (lifeibo)
*) Feature: added support for geoip regional database in geoip module.
(jasonlfunk)
*) Feature: log_empty_request can also disable the logs for timeout (408)
empty request. (yaoweibin)
*) Change: merged changes between Nginx-1.2.5 and Nginx-1.2.7. (cfsego)
*) Change: CPU affinity is off by default now. (cfsego)
*) Bugfix: fixed a bug that sysguard and upstream_check module didn't
compile on Solaris 11. (lifeibo, yaoweibin)
*) Bugfix: fixed a bug with TFS module that it might return bad values.
(zhcn381)
*) Bugfix: fixed a bug with TFS module that it might corrupt large files.
(zhcn381)
Changes with Tengine 1.4.3 21 Jan 2013
*) Feature: added the TFS module which provides a RESTful API to Taobao
File System. (zhcn381, monadbobo)
*) Feature: added a $sent_cookie_XXX variable which could be used to get
the value of cookie XXX from the Set-Cookie headers. (skoo87)
*) Feature: now the syslog logging supports host name and domain name as
its destination address. (cfsego)
*) Change: added an attribute 'id' for the server directive in the upstream
block. (yaoweibin)
*) Bugfix: fixed a bug of DSO module which might stop Tengine from
reloading. (monadbobo)
*) Bugfix: fixed a segmentation fault bug of upstream_check module when
the check timeout was larger than the check interval. (yaoweibin)
*) Bugfix: fixed a segmentation fault bug of user_agent module when there
was no User-Agent header existed in a request. (dinic)
*) Bugfix: fixed the bug that sysguard module didn't work on Mac OS. (lizi)
Changes with Tengine 1.4.2 22 Nov 2012
*) Feature: added the option '--dso-tool-path' to configure script, which
can specify the installation path for the dso_tool script. (monadbobo)
*) Feature: added a new variable '$unix_time', whose value is the current
number of seconds since unix epoch time. (yaoweibin)
*) Feature: added the 'make test' target to run test cases. (yaoweibin)
*) Feature: now the sysguard module can be used in a location block.
(lifeibo)
*) Change: merged the changes from Nginx-1.2.4 and Nginx-1.2.5.
(zhuzhaoyuan)
*) Change: now checks the error codes of input body filters more carefully
to avoid socket leaks. (cfsego)
*) Bugfix: fixed the problem with directive limit_req can't handle 4
arguments. (monadbobo)
Thanks to LazyZhu.
*) Bugfix: fixed a compilation error with the file of sysinfo in Cygwin.
(lifeibo)
Thanks to Cao Peiran.
*) Bugfix: now the installation script will copy the user_agent module's
configuration. (monadbobo)
Thanks to Jianbin Xiao.
*) Bugfix: fixed the installation directory error with the DSO module
when creating the RPM package. (monadbobo)
Thanks to Jianbin Xiao and Ren Xiaolei.
Changes with Tengine 1.4.1 10 Oct 2012
*) Feature: added jemalloc library support. (fanjizhao)
*) Feature: added a new variable '$dollar', whose value is the dollar
sign ('$'). (zhuzhaoyuan)
*) Feature: added the option 'off' to 'worker_cpu_affinity' directive.
(cfsego)
*) Change: disable CPU affinity when a new worker process is forked as
an old one exits abnormally. (cfsego)
*) Bugfix: fixed compile error with shared Lua module when using LuaJIT
in Mac OS. (monadbobo)
*) Bugfix: fixed the wrong module execution order with the third party
shared filter module. (monadbobo)
Changes with Tengine 1.4.0 05 Sep 2012
*) Feature: added the dynamic module loading support (a.k.a. DSO), so we
don't have to recompile tengine when we want to add a new module.
(monadbobo)
*) Feature: updated the Lua module to the latest stable version.
(chaoslawful, agentzh, jinglong)
*) Feature: added json and csv format output for the upstream_check
module. (yaoweibin)
*) Feature: added the 'log_empty_request' directive which could be used
to turn off logs from a connection without HTTP data. (zhuzhaoyuan)
*) Feature: added the 'concat_delimiter' directive to the concat module
to allow adding delimiter between each file. (dinic)
*) Feature: added the 'concat_ignore_file_error' directive to ignore file
errors and the syntax of concat is less strict now. (dinic)
*) Feature: added the 'default' option to the 'error_page' directive to
set all error pages to default values. (jinglong)
*) Feature: added the 'priority' directive of the procs module.
(yzprofile)
*) Feature: added the 'delay_start' directive of the procs module.
(yzprofile)
*) Change: merged changes from nginx-1.2.3. (zhuzhaoyuan)
*) Bugfix: fixed a segmentation fault bug of the geo module when 'range'
was set without default value. (yzprofile)
*) Bugfix: fixed a segmentation fault bug with the procs module.
(yzprofile)
*) Bugfix: fixed a socket leak bug when upstream_check was enabled.
(yaoweibin)
*) Bugfix: fixed some bugs of the limit_req module. (monadbobo)
*) Bugfix: fixed wrong format types with error logs. (yaoweibin)
*) Bugfix: fixed a compile error if the perl module was used with procs.
(yzprofile)
Changes with Tengine 1.3.0 25 May 2012
*) Feature: added the Lua module which embeds the power of Lua into Tengine.
(chaoslawful, agentzh)
*) Feature: added the procs module which provides a mechanism to support
standalone processes. (yzprofile)
*) Change: renamed the parameter from 'nongreedy' to 'greedy' in the
user_agent module. (dinic)
*) Bugfix: fixed a segmentation fault bug in syslog with uninitialized
pointer problem. (cfsego)
*) Bugfix: fixed a compile error in syslog with '--with-ipv6' configuration
parameter. (cfsego)
Changes with Tengine 1.2.5 09 May 2012
*) Feature: added the upstream_check module which could be used to do
proactive health check of upstream servers. (yaoweibin)
*) Feature: now allow to specify program identifiers with syslogs. (cfsego)
*) Change: merged changes between nginx-1.0.14 and nginx-1.0.15.
(zhuzhaoyuan)
*) Change: the default value of 'accept_mutex_delay' was changed from
500ms to 100ms to gain better performance. (zhuzhaoyuan)
*) Bugfix: fixed a segmentation fault bug in syslog when failed to connect
to an upstream server. (cfsego)
*) Bugfix: fixed the bug of 'access_log' might not be compatible with the
'buffer' parameter. (cfsego)
Changes with Tengine 1.2.4 30 Mar 2012
*) Feature: added the user_agent module. (dinic)
*) Feature: added the 'log_escape' directive. (agentzh, skoo87)
*) Change: merged changes between nginx-1.0.12 and nginx-1.0.14.
(zhuzhaoyuan)
*) Bugfix: fixed a bug in the limit_req module. (liseen.wan)
*) Bugfix: fixed a bug in subrequest. (lifeibo)
Changes with Tengine 1.2.3 27 Feb 2012
*) Feature: added the 'request_time_cache' directive to get more precise
$request_time/$request_time_msec/$request_time_usec. (yzprofile)
*) Feature: added the slice module. (zhuzhaoyuan)
*) Change: merged changes between nginx-1.0.11 and nginx-1.0.12.
(zhuzhaoyuan)
*) Change: deleted unused browsers detection. (zhuzhaoyuan)
*) Bugfix: fixed a bug in upstream when reading header. (lifeibo)
*) Bugfix: fixed a bug in 'expires_by_types'. (lifeibo)
Changes with Tengine 1.2.2 11 Jan 2012
*) Feature: added the input body filter mechanism. (cfsego)
*) Feature: added SSL dialog support to the mail module. (cfsego)
*) Change: merged changes between nginx-1.0.10 and nginx-1.0.11.
(zhuzhaoyuan)
*) Change: turned 'lingering_close' off by default. (zhuzhaoyuan)
*) Bugfix: fixed a bug in pipe logs. (cfsego)
*) Bugfix: fixed a 'forbid_action' bug in the limit_req module.
(monadbobo)
*) Bugfix: fixed a bug in 'backtrace_max_stack_size'. (monadbobo)
*) Bugfix: fixed a bug in the footer module when output body is empty.
(dinic)
*) Bugfix: fixed the last hostname letter omitted bug in syslog.
(cfsego)
Changes with Tengine 1.2.1 06 Dev 2011
*) Bugfix: fixed a segmentation fault bug when using default error log
or access log. (yzprofile)
Changes with Tengine 1.2.0 29 Nov 2011
*) This is the first public release.
*) Feature: added syslog support to error_log and access_log. (cfsego)
*) Feature: added pipe support to error_log and access_log. (cfsego)
*) Feature: added realloc() related APIs. (gongyuan)
*) Feature: added time specific variables. (skoo87)
*) Feature: added the backtrace module. (monadbobo)
*) Feature: added whitelist support to the limit_req module. (monadbobo)
*) Feature: now more limit_req directives are allowed in a single location.
(monadbobo)
*) Feature: added the sysguard module. (lifeibo)
*) Feature: added two APIs, ngx_http_header_in and ngx_http_header_out.
(lifeibo)
*) Feature: added two variables, $request_time_msec and $request_time_usec.
(jinglong)
*) Feature: added the footer module. (yunxing)
*) Feature: added the $conn_requests variable which is similar to Apache's
'%K'. (lieyuan)
*) Feature: added the $host_comment variable. (yunxing)
*) Feature: added a 'ratio' parameter to access_log so now access log can
be sampled. (cfsego)
*) Feature: added the 'server_info' and 'server_admin' directives to show
more information when 4xx/5xx errors encountered. (lieyuan)
*) Feature: added the '-d' command line option to dump contents of
the configuration files. (piaoling)
*) Feature: added response time statistics to the stub_status module.
(jinglong)
*) Feature: added the 'server_tag' directive. (zhuzhaoyuan)
*) Feature: now the 'worker_processes' supports the 'auto' parameter, which
sets the worker process numbers to the cores automatically. (cfsego)
*) Feature: now the 'worker_cpu_affinity' directive supports the 'auto'
parameter, which binds the worker processes to the cores automatically.
(cfsego)
*) Feature: added the 'ssl_pass_phrase_dialog' directive. (cfsego)
*) Feature: added the '-s start' command line option. (zhuzhaoyuan)
*) Feature: added '-m' command line option to list all compiled-in modules.
(zhuzhaoyuan)
*) Feature: added the 'expires_by_types' directive. (lifeibo)
*) Feature: added the '-l' command line option to list all supported
directives. (dinic)
*) Feature: added the ngx_atoll() API, which can convert a string to a long
long integer (64 bits). (lifeibo)
*) Feature: now status lines (302, 405) are RFC-2616 compatibale. (zhuzhaoyuan)
*) Feature: now ngx_escape_uri/ngx_unescape_uri supports encoding/decoding
style of Java and PHP. (zhuzhaoyuan)
*) Feature: now configuration files included are sorted. (zhuzhaoyuan)
*) Feature: now 'error_page' can be reset to 'default' (zhuzhaoyuan)
*) Change: turned 'msie_padding' off by default. (zhuzhaoyuan)
*) Bugfix: fixed a bug when subrequest_in_memory and upstream keepalive
being used. (lifeibo)
*) Bugfix: fixed a bug in $sent_http_connection and $sent_http_keep_alive.
(zhongsheng)
*) Bugfix: fixed a bug that error_page directive can't detect duplicate
codes and inherited correctly. (zhuzhaoyuan)
*) Bugfix: fixed a segmentation fault bug in the FastCGI module, while
processing duplicated HTTP headers. (monadbobo)
*) Bugfix: fixed a bug that file in open_file_cache can't be updated.
(cfsego)
*) Bugfix: fixed a bug in 'worker_cpu_affinity'. (cfsego)

32
Dengine/tengine/LICENSE Normal file
View file

@ -0,0 +1,32 @@
/*
* Copyright (C) 2002-2013 Igor Sysoev
* Copyright (C) 2011,2013 Nginx, Inc.
* Copyright (C) 2010-2015 Alibaba Group Holding Limited
* Copyright (C) 2011-2013 Xiaozhe "chaoslawful" Wang
* Copyright (C) 2011-2013 Zhang "agentzh" Yichun
* Copyright (C) 2011-2013 Weibin Yao
* Copyright (C) 2012-2013 Sogou, Inc.
* Copyright (C) 2012-2013 NetEase, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

58
Dengine/tengine/README Normal file
View file

@ -0,0 +1,58 @@
Introduction
------------
Tengine is a web server originated by Taobao, the largest e-commerce website in Asia. It is based on the Nginx HTTP server and has many advanced features. Tengine has proven to be very stable and efficient on some of the top 100 websites in the world, including taobao.com and tmall.com.
Tengine has been an open source project since December 2011. It is being actively developed by the Tengine team, whose core members are from Taobao, Sogou and other Internet companies. Tengine is a community effort and everyone is encouraged to get involved.
Features
--------
* All features of nginx-1.6.2 are inherited, i.e., it is 100% compatible with nginx.
* Dynamic module loading support. You don't need to recompile Tengine when adding new modules to it.
* SPDY v3 support, and SPDY/HTTP servers can listen on the same port.
* Sends unbuffered upload directly to HTTP and FastCGI backend servers, which saves disk I/Os.
* More load balancing methods, e.g., consistent hashing, and session persistence.
* Input body filter support. It's quite handy to write Web Application Firewalls using this mechanism.
* Dynamic scripting language (Lua) support, which is very efficient and makes it easy to extend core functionalities.
* Logging enhancements. Syslog (local and remote), pipe logging, and log sampling are supported.
* Limits retries for upstream servers (proxy, memcached, fastcgi, scgi, uwsgi).
* Includes a mechanism to support standalone processes.
* Protects the server in case system load or memory use goes too high.
* Multiple CSS or JavaScript requests can be combined into one request to reduce download time.
* Removes unnecessary white spaces and comments to reduce the size of a page.
* Proactive health checks of upstream servers can be performed.
* The number of worker processes and CPU affinities can be set automatically.
* The limit_req module is enhanced with whitelist support and more conditions are allowed in a single location.
* Enhanced diagnostic information makes it easier to troubleshoot errors.
* More user-friendly command lines, e.g., showing all compiled-in modules and supported directives.
* Expiration times can be specified for certain MIME types.
* Error pages can be reset to 'default'.
* ...
Installation
------------
Tengine can be downloaded at http://tengine.taobao.org/download/tengine.tar.gz . You can also checkout the latest source code from GitHub at https://github.com/alibaba/tengine
To install Tengine, just follow these three steps:
$ ./configure
$ make
# make install
By default, it will be installed to /usr/local/nginx. You can use the '--prefix' option to specify the root directory.
If you want to know all the 'configure' options, you should run './configure --help' for help.
Documentation
-------------
The homepage of Tengine is at http://tengine.taobao.org
You can access http://tengine.taobao.org/documentation.html for more information.
Mailing lists
-------------
Mailing lists are usually good places to ask questions. We highly recommend you subscribe to Tengine's mailing lists below:
http://code.taobao.org/mailman/listinfo/tengine (English)
http://code.taobao.org/mailman/listinfo/tengine-cn (Chinese)

View file

@ -0,0 +1,60 @@
Introduction [![Build Status](https://travis-ci.org/alibaba/tengine.svg?branch=master)](https://travis-ci.org/alibaba/tengine)
============
Tengine is a web server originated by [Taobao](http://en.wikipedia.org/wiki/Taobao), the largest e-commerce website in Asia. It is based on the [Nginx](http://nginx.org) HTTP server and has many advanced features. Tengine has proven to be very stable and efficient on some of the top 100 websites in the world, including [taobao.com](http://www.taobao.com) and [tmall.com](http://www.tmall.com).
Tengine has been an open source project since December 2011. It is being actively developed by the Tengine team, whose core members are from Taobao, Sogou and other Internet companies. Tengine is a community effort and everyone is encouraged to [get involved](https://github.com/alibaba/tengine).
Features
========
* All features of nginx-1.6.2 are inherited, i.e., it is 100% compatible with nginx.
* Dynamic module loading support. You don't need to recompile Tengine when adding new modules to it.
* SPDY v3 support, and SPDY/HTTP servers can listen on the same port.
* Sends unbuffered upload directly to HTTP and FastCGI backend servers, which saves disk I/Os.
* More load balancing methods, e.g., consistent hashing, and session persistence.
* Input body filter support. It's quite handy to write Web Application Firewalls using this mechanism.
* Dynamic scripting language (Lua) support, which is very efficient and makes it easy to extend core functionalities.
* Logging enhancements. Syslog (local and remote), pipe logging, and log sampling are supported.
* Limits retries for upstream servers (proxy, memcached, fastcgi, scgi, uwsgi).
* Includes a mechanism to support standalone processes.
* Protects the server in case system load or memory use goes too high.
* Multiple CSS or JavaScript requests can be combined into one request to reduce download time.
* Removes unnecessary white spaces and comments to reduce the size of a page.
* Proactive health checks of upstream servers can be performed.
* The number of worker processes and CPU affinities can be set automatically.
* The limit_req module is enhanced with whitelist support and more conditions are allowed in a single location.
* Enhanced diagnostic information makes it easier to troubleshoot errors.
* More user-friendly command lines, e.g., showing all compiled-in modules and supported directives.
* Expiration times can be specified for certain MIME types.
* Error pages can be reset to 'default'.
* ...
Installation
============
Tengine can be downloaded at [http://tengine.taobao.org/download/tengine.tar.gz](http://tengine.taobao.org/download/tengine.tar.gz). You can also checkout the latest source code from GitHub at [https://github.com/alibaba/tengine](https://github.com/alibaba/tengine)
To install Tengine, just follow these three steps:
$ ./configure
$ make
# make install
By default, it will be installed to _/usr/local/nginx_. You can use the __'--prefix'__ option to specify the root directory.
If you want to know all the _'configure'_ options, you should run __'./configure --help'__ for help.
Documentation
=============
The homepage of Tengine is at [http://tengine.taobao.org/](http://tengine.taobao.org/)
You can access [http://tengine.taobao.org/documentation.html](http://tengine.taobao.org/documentation.html) for more information.
Mailing lists
=============
Mailing lists are usually good places to ask questions. We highly recommend you subscribe to Tengine's mailing lists below:
* [http://code.taobao.org/mailman/listinfo/tengine](http://code.taobao.org/mailman/listinfo/tengine) (English)
* [http://code.taobao.org/mailman/listinfo/tengine-cn](http://code.taobao.org/mailman/listinfo/tengine-cn) (Chinese)

View file

@ -0,0 +1,2 @@
perusio (António P. P. Almeida)
liseen.wan

View file

@ -0,0 +1,15 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# aCC: HP ANSI C++ B3910B A.03.55.02
# C89 mode
CFLAGS="$CFLAGS -Ae"
CC_TEST_FLAGS="-Ae"
PCRE_OPT="$PCRE_OPT -Ae"
ZLIB_OPT="$ZLIB_OPT -Ae"
MD5_OPT="$MD5_OPT -Ae"

View file

@ -0,0 +1,72 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Borland C++ 5.5
# optimizations
# maximize speed
CFLAGS="$CFLAGS -O2"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-5"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-6"
;;
esac
# __stdcall
#CPU_OPT="$CPU_OPT -ps"
# __fastcall
#CPU_OPT="$CPU_OPT -pr"
CFLAGS="$CFLAGS $CPU_OPT"
# multithreaded
CFLAGS="$CFLAGS -tWM"
# stop on warning
CFLAGS="$CFLAGS -w!"
# disable logo
CFLAGS="$CFLAGS -q"
# precompiled headers
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm"
NGX_PCH="$NGX_OBJS/ngx_config.csm"
NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm"
NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
# Win32 GUI mode application
#LINK="\$(CC) -laa"
# the resource file
NGX_RES="$NGX_OBJS/nginx.res"
NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC"
# the pragma allows to link the resource file using bcc32 and
# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem
NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\""
ngx_include_opt="-I"
ngx_objout="-o"
ngx_binout="-e"
ngx_objext="obj"
ngx_binext=".exe"
ngx_long_start='@&&|
'
ngx_long_end='|'
ngx_regex_dirsep='\\'
ngx_dirsep="\\"

View file

@ -0,0 +1,46 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Compaq C V6.5-207
ngx_include_opt="-I"
# warnings
CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6"
CFLAGS="$CFLAGS -msg_disable unknownmacro"
CFLAGS="$CFLAGS -msg_disable unusedincl"
CFLAGS="$CFLAGS -msg_disable unnecincl"
CFLAGS="$CFLAGS -msg_disable nestincl"
CFLAGS="$CFLAGS -msg_disable strctpadding"
CFLAGS="$CFLAGS -msg_disable ansialiascast"
CFLAGS="$CFLAGS -msg_disable inlinestoclsmod"
CFLAGS="$CFLAGS -msg_disable cxxkeyword"
CFLAGS="$CFLAGS -msg_disable longlongsufx"
CFLAGS="$CFLAGS -msg_disable valuepres"
# STUB
CFLAGS="$CFLAGS -msg_disable truncintcast"
CFLAGS="$CFLAGS -msg_disable trunclongcast"
CFLAGS="$CFLAGS -msg_disable truncintasn"
CFLAGS="$CFLAGS -msg_disable trunclongint"
CFLAGS="$CFLAGS -msg_disable intconcastsgn"
CFLAGS="$CFLAGS -msg_disable intconstsign"
CFLAGS="$CFLAGS -msg_disable switchlong"
CFLAGS="$CFLAGS -msg_disable subscrbounds2"
CFLAGS="$CFLAGS -msg_disable hexoctunsign"
CFLAGS="$CFLAGS -msg_disable ignorecallval"
CFLAGS="$CFLAGS -msg_disable nonstandcast"
CFLAGS="$CFLAGS -msg_disable embedcomment"
CFLAGS="$CFLAGS -msg_disable unreachcode"
CFLAGS="$CFLAGS -msg_disable questcompare2"
CFLAGS="$CFLAGS -msg_disable unusedtop"
CFLAGS="$CFLAGS -msg_disable unrefdecl"
CFLAGS="$CFLAGS -msg_disable bitnotint"

View file

@ -0,0 +1,99 @@
# Copyright (C) Nginx, Inc.
# clang
NGX_CLANG_VER=`$CC -v 2>&1 | grep '\(clang\|LLVM\) version' 2>&1 \
| sed -e 's/^.* version \(.*\)/\1/'`
echo " + clang version: $NGX_CLANG_VER"
have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
CC_TEST_FLAGS="-pipe"
# optimizations
#NGX_CLANG_OPT="-O2"
#NGX_CLANG_OPT="-Oz"
NGX_CLANG_OPT="-O"
case $CPU in
pentium)
# optimize for Pentium
CPU_OPT="-march=pentium"
NGX_CPU_CACHE_LINE=32
;;
pentiumpro | pentium3)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-march=pentiumpro"
NGX_CPU_CACHE_LINE=32
;;
pentium4)
# optimize for Pentium 4
CPU_OPT="-march=pentium4"
NGX_CPU_CACHE_LINE=128
;;
athlon)
# optimize for Athlon
CPU_OPT="-march=athlon"
NGX_CPU_CACHE_LINE=64
;;
opteron)
# optimize for Opteron
CPU_OPT="-march=opteron"
NGX_CPU_CACHE_LINE=64
;;
esac
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
CFLAGS="$CFLAGS -pipe $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -pipe $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT -pipe"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -pipe $CPU_OPT"
else
MD5_OPT="$MD5_OPT -pipe"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -pipe $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT -pipe"
fi
# warnings
CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
#CFLAGS="$CFLAGS -Wconditional-uninitialized"
#CFLAGS="$CFLAGS -Wmissing-prototypes"
# we have a lot of unused function arguments
CFLAGS="$CFLAGS -Wno-unused-parameter"
# stop on warning
CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi

View file

@ -0,0 +1,234 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
LINK=${LINK:-"\$(CC)"}
ngx_include_opt="-I "
ngx_compile_opt="-c"
ngx_objout="-o "
ngx_binout="-o "
ngx_objext="o"
ngx_binext=
ngx_long_start=
ngx_long_end=
ngx_regex_dirsep="\/"
ngx_dirsep='/'
ngx_regex_cont=' \\\
'
ngx_cont=' \
'
ngx_tab=' \
'
ngx_spacer=
ngx_long_regex_cont=$ngx_regex_cont
ngx_long_cont=$ngx_cont
. auto/cc/name
if test -n "$CFLAGS"; then
CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
case $NGX_CC_NAME in
ccc)
# Compaq C V6.5-207
ngx_include_opt="-I"
;;
sunc)
case "$NGX_MACHINE" in
i86pc)
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
;;
sun4u | sun4v)
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
;;
esac
case $CPU in
amd64)
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
;;
esac
;;
esac
else
case $NGX_CC_NAME in
gcc)
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
# 4.0.0, 4.0.1, 4.1.0
. auto/cc/gcc
;;
clang)
# Clang C compiler
. auto/cc/clang
;;
icc)
# Intel C++ compiler 7.1, 8.0, 8.1
. auto/cc/icc
;;
sunc)
# Sun C 5.7 Patch 117837-04 2005/05/11
. auto/cc/sunc
;;
ccc)
# Compaq C V6.5-207
. auto/cc/ccc
;;
acc)
# aCC: HP ANSI C++ B3910B A.03.55.02
. auto/cc/acc
;;
msvc*)
# MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
. auto/cc/msvc
;;
owc)
# Open Watcom C 1.0, 1.2
. auto/cc/owc
;;
bcc)
# Borland C++ 5.5
. auto/cc/bcc
;;
esac
CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
fi
CFLAGS="$CFLAGS $NGX_CC_OPT"
NGX_TEST_LD_OPT="$NGX_LD_OPT"
if [ "$NGX_PLATFORM" != win32 ]; then
if test -n "$NGX_LD_OPT"; then
ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test=
. auto/feature
if [ $ngx_found = no ]; then
echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
echo
exit 1
fi
fi
ngx_feature="gcc builtin atomic operations"
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
ngx_feature_run=yes
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="long n = 0;
if (!__sync_bool_compare_and_swap(&n, 0, 1))
return 1;
if (__sync_fetch_and_add(&n, 1) != 1)
return 1;
if (n != 2)
return 1;
__sync_synchronize();"
. auto/feature
if [ "$NGX_CC_NAME" = "ccc" ]; then
echo "checking for C99 variadic macros ... disabled"
else
ngx_feature="C99 variadic macros"
ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
ngx_feature_run=yes
ngx_feature_incs="#include <stdio.h>
#define var(dummy, ...) sprintf(__VA_ARGS__)"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[30]; buf[0] = '0';
var(0, buf, \"%d\", 1);
if (buf[0] != '1') return 1"
. auto/feature
fi
ngx_feature="gcc variadic macros"
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
ngx_feature_run=yes
ngx_feature_incs="#include <stdio.h>
#define var(dummy, args...) sprintf(args)"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[30]; buf[0] = '0';
var(0, buf, \"%d\", 1);
if (buf[0] != '1') return 1"
. auto/feature
ngx_feature="compiler structure-packing pragma"
ngx_feature_name="NGX_HAVE_PACK_PRAGMA"
ngx_feature_run=yes
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="#pragma pack(push, 1)
struct test_s {
char foo;
int bar;
};
#pragma pack(pop)
if (sizeof(struct test_s) != (sizeof(char) + sizeof(int)))
return 1;"
. auto/feature
# ngx_feature="inline"
# ngx_feature_name=
# ngx_feature_run=no
# ngx_feature_incs="int inline f(void) { return 1 }"
# ngx_feature_path=
# ngx_feature_libs=
# ngx_feature_test=
# . auto/feature
#
# if [ $ngx_found = yes ]; then
# fi
fi

181
Dengine/tengine/auto/cc/gcc Normal file
View file

@ -0,0 +1,181 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
# 4.0.0, 4.0.1, 4.1.0
NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
| sed -e 's/^.* version \(.*\)/\1/'`
echo " + gcc version: $NGX_GCC_VER"
have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
CC_TEST_FLAGS="-pipe"
ngx_feature="gcc -pipe switch"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test=
. auto/feature
CC_TEST_FLAGS=
if [ $ngx_found = yes ]; then
PIPE="-pipe"
fi
case "$NGX_MACHINE" in
sun4u | sun4v | sparc | sparc64 )
# "-mcpu=v9" enables the "casa" assembler instruction
CFLAGS="$CFLAGS -mcpu=v9"
;;
esac
# optimizations
#NGX_GCC_OPT="-O2"
#NGX_GCC_OPT="-Os"
NGX_GCC_OPT="-O"
#CFLAGS="$CFLAGS -fomit-frame-pointer"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
NGX_CPU_CACHE_LINE=32
;;
pentiumpro | pentium3)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-march=pentiumpro"
NGX_CPU_CACHE_LINE=32
;;
pentium4)
# optimize for Pentium 4, gcc 3.x
CPU_OPT="-march=pentium4"
NGX_CPU_CACHE_LINE=128
;;
athlon)
# optimize for Athlon, gcc 3.x
CPU_OPT="-march=athlon"
NGX_CPU_CACHE_LINE=64
;;
opteron)
# optimize for Opteron, gcc 3.x
CPU_OPT="-march=opteron"
NGX_CPU_CACHE_LINE=64
;;
sparc32)
# build 32-bit UltraSparc binary
CPU_OPT="-m32"
CORE_LINK="$CORE_LINK -m32"
NGX_CPU_CACHE_LINE=64
;;
sparc64)
# build 64-bit UltraSparc binary
CPU_OPT="-m64"
CORE_LINK="$CORE_LINK -m64"
NGX_CPU_CACHE_LINE=64
;;
ppc64)
# build 64-bit PowerPC binary
CPU_OPT="-m64"
CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
CORE_LINK="$CORE_LINK -m64"
NGX_CPU_CACHE_LINE=128
;;
esac
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
case "$NGX_GCC_VER" in
2.7*)
# batch build
CPU_OPT=
;;
esac
CFLAGS="$CFLAGS $PIPE $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT $PIPE"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
MD5_OPT="$MD5_OPT $PIPE"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT $PIPE"
fi
# warnings
# -W requires at least -O
CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
#CFLAGS="$CFLAGS -Wconversion"
#CFLAGS="$CFLAGS -Winline"
#CFLAGS="$CFLAGS -Wmissing-prototypes"
case "$NGX_GCC_VER" in
3.* | 4.* )
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused-parameter"
# 4.2.1 shows the warning in wrong places
#CFLAGS="$CFLAGS -Wunreachable-code"
;;
*)
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused"
;;
esac
# stop on warning
CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
# DragonFly's gcc3 generates DWARF
#CFLAGS="$CFLAGS -g -gstabs"
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi

121
Dengine/tengine/auto/cc/icc Normal file
View file

@ -0,0 +1,121 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
| sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
echo " + icc version: $NGX_ICC_VER"
have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
# optimizations
CFLAGS="$CFLAGS -O"
CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
;;
pentium4)
# optimize for Pentium 4, default
CPU_OPT="-march=pentium4"
;;
esac
CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O $CPU_OPT"
fi
# warnings
CFLAGS="$CFLAGS -w2"
# disable some warnings
# invalid type conversion: "int" to "char *"
CFLAGS="$CFLAGS -wd171"
# argument is incompatible with corresponding format string conversion
CFLAGS="$CFLAGS -wd181"
# zero used for undefined preprocessing identifier
CFLAGS="$CFLAGS -wd193"
# the format string ends before this argument
CFLAGS="$CFLAGS -wd268"
# invalid format string conversion
CFLAGS="$CFLAGS -wd269"
# conversion from "long long" to "size_t" may lose significant bits
CFLAGS="$CFLAGS -wd810"
# parameter was never referenced
CFLAGS="$CFLAGS -wd869"
# attribute "unused" is only allowed in a function definition, warning on pTHX_
CFLAGS="$CFLAGS -wd1301"
# STUB
# enumerated type mixed with another type
CFLAGS="$CFLAGS -wd188"
# controlling expression is constant
CFLAGS="$CFLAGS -wd279"
# operands are evaluated in unspecified order
CFLAGS="$CFLAGS -wd981"
# external definition with no prior declaration
CFLAGS="$CFLAGS -wd1418"
# external declaration in primary source file
CFLAGS="$CFLAGS -wd1419"
case "$NGX_ICC_VER" in
9.*)
# "cc" clobber ignored, warnings for Liunx's htonl()/htons()
CFLAGS="$CFLAGS -wd1469"
# explicit conversion of a 64-bit integral type to a smaller
# integral type
CFLAGS="$CFLAGS -wd1683"
# conversion from pointer to same-sized integral type,
# warning on offsetof()
CFLAGS="$CFLAGS -wd1684"
# floating-point equality and inequality comparisons are unreliable,
# warning on SvTRUE()
CFLAGS="$CFLAGS -wd1572"
;;
8.*)
# "cc" clobber ignored, warnings for Liunx's htonl()/htons()
CFLAGS="$CFLAGS -wd1469"
# floating-point equality and inequality comparisons are unreliable,
# warning on SvTRUE()
CFLAGS="$CFLAGS -wd1572"
;;
*)
;;
esac
# stop on warning
CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"

View file

@ -0,0 +1,136 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# MSVC 6.0 SP2
# MSVC Toolkit 2003 (7.1)
# MSVC 2005 Express Edition SP1 (8.0)
# optimizations
# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
CFLAGS="$CFLAGS -O2"
# enable global optimization
#CFLAGS="$CFLAGS -Og"
# enable intrinsic functions
#CFLAGS="$CFLAGS -Oi"
# disable inline expansion
#CFLAGS="$CFLAGS -Ob0"
# explicit inline expansion
#CFLAGS="$CFLAGS -Ob1"
# explicit and implicit inline expansion
#CFLAGS="$CFLAGS -Ob2"
# enable frame pointer omission
#CFLAGS="$CFLAGS -Oy"
# disable stack checking calls
#CFLAGS="$CFLAGS -Gs"
# pools strings as read/write
#CFLAGS="$CFLAGS -Gf"
# pools strings as read-only
#CFLAGS="$CFLAGS -GF"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-G5"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-G6"
;;
pentium4)
# optimize for Pentium 4, MSVC 7
CPU_OPT="-G7"
;;
esac
# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
#CPU_OPT="$CPU_OPT -Gd"
# __stdcall
#CPU_OPT="$CPU_OPT -Gz"
# __fastcall
#CPU_OPT="$CPU_OPT -Gr"
CFLAGS="$CFLAGS $CPU_OPT"
# warnings
CFLAGS="$CFLAGS -W4"
# stop on warning
CFLAGS="$CFLAGS -WX"
# disable logo
CFLAGS="$CFLAGS -nologo"
# the link flags
CORE_LINK="$CORE_LINK -link -verbose:lib"
# link with libcmt.lib, multithreaded
LIBC="-MT"
# link with msvcrt.dll
# however, MSVC Toolkit 2003 has no MSVCRT.LIB
#LIBC="-MD"
CFLAGS="$CFLAGS $LIBC"
CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
# Win32 GUI mode application
#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
# debug
# msvc8 under Wine issues
# Program database manager mismatch; please check your installation
if [ $NGX_CC_NAME != msvc8 ]; then
CFLAGS="$CFLAGS -Zi"
CORE_LINK="$CORE_LINK -debug"
fi
# MSVC 2005 supports C99 variadic macros
if [ $NGX_CC_NAME = msvc8 ]; then
have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
fi
# precompiled headers
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
CORE_LINK="$CORE_LINK $NGX_OBJS/ngx_pch.obj"
NGX_PCH="$NGX_OBJS/ngx_config.pch"
NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
# the resource file
NGX_RES="$NGX_OBJS/nginx.res"
NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
CORE_LINK="$NGX_RES $CORE_LINK"
ngx_objout="-Fo"
ngx_binout="-Fe"
ngx_objext="obj"
ngx_binext=".exe"
ngx_long_start='@<<
'
ngx_long_end='<<'
ngx_long_regex_cont=' \
'
ngx_long_cont='
'
# MSVC understand / in path
#ngx_regex_dirsep='\\'
#ngx_dirsep="\\"

View file

@ -0,0 +1,89 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ "$NGX_PLATFORM" != win32 ]; then
ngx_feature="C compiler"
ngx_feature_name=
ngx_feature_run=yes
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test=
. auto/feature
if [ $ngx_found = no ]; then
echo
echo $0: error: C compiler $CC is not found
echo
exit 1
fi
fi
if [ "$CC" = cl ]; then
if `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16' \
>/dev/null 2>&1`; then
NGX_CC_NAME=msvc10
echo " + using Microsoft Visual C++ 10 compiler"
elif `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
>/dev/null 2>&1`; then
NGX_CC_NAME=msvc8
echo " + using Microsoft Visual C++ 8 compiler"
elif `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
>/dev/null 2>&1`; then
NGX_CC_NAME=msvc7
echo " + using Microsoft Visual C++ 7 compiler"
else
NGX_CC_NAME=msvc
echo " + using Microsoft Visual C++ compiler"
fi
elif [ "$CC" = wcl386 ]; then
NGX_CC_NAME=owc
echo " + using Open Watcom C compiler"
elif [ "$CC" = bcc32 ]; then
NGX_CC_NAME=bcc
echo " + using Borland C++ compiler"
elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"
elif `$CC -v 2>&1 | grep '\(clang\|LLVM\) version' >/dev/null 2>&1`; then
NGX_CC_NAME=clang
echo " + using Clang C compiler"
elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
NGX_CC_NAME=sunc
echo " + using Sun C compiler"
elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
NGX_CC_NAME=ccc
echo " + using Compaq C compiler"
elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
NGX_CC_NAME=acc
echo " + using HP aC++ compiler"
else
NGX_CC_NAME=unknown
fi

104
Dengine/tengine/auto/cc/owc Normal file
View file

@ -0,0 +1,104 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Open Watcom C 1.0, 1.2, 1.3
# optimizations
# maximize speed
CFLAGS="$CFLAGS -ot"
# reorder instructions for best pipeline usage
CFLAGS="$CFLAGS -op"
# inline intrinsic functions
CFLAGS="$CFLAGS -oi"
# inline expansion
CFLAGS="$CFLAGS -oe"
# disable stack checking calls
CFLAGS="$CFLAGS -s"
case $CPU in
pentium)
# optimize for Pentium and Athlon
# register-based arguments passing conventions
CPU_OPT="-5r"
# stack-based arguments passing conventions
#CPU_OPT="-5s"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
# register-based arguments passing conventions
CPU_OPT="-6r"
# stack-based arguments passing conventions
#CPU_OPT="-6s"
;;
esac
CFLAGS="$CFLAGS $CPU_OPT"
# warnings
# maximum level
CFLAGS="$CFLAGS -wx"
#CFLAGS="$CFLAGS -w3"
# stop on warning
CFLAGS="$CFLAGS -we"
# built target is NT
CFLAGS="$CFLAGS -bt=nt"
# multithreaded
CFLAGS="$CFLAGS -bm"
# debug
CFLAGS="$CFLAGS -d2"
# quiet
CFLAGS="$CFLAGS -zq"
# Open Watcom C 1.2
have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
# the precompiled headers
#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
#NGX_PCH="$NGX_OBJS/ngx_config.pch"
#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
# the link flags, built target is NT GUI mode application
#CORE_LINK="$CORE_LINK -l=nt_win"
# the resource file
NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res "
NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe"
ngx_include_opt="-i="
ngx_objout="-fo"
ngx_binout="-fe="
ngx_objext="obj"
ngx_binext=".exe"
ngx_regex_dirsep='\\'
ngx_dirsep="\\"
ngx_long_start=' '
ngx_long_end=' '
ngx_long_regex_cont=' \&\
'
ngx_long_cont=' &
'
ngx_regex_cont=' \&\
'
ngx_cont=' &
'
ngx_tab=' &
'

View file

@ -0,0 +1,158 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
# Sun C 5.8 2005/10/13 Sun Studio 11
# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
# Sun C 5.9 SunOS_sparc 2007/05/03
# Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1
# Sun C 5.11 SunOS_i386 2010/08/13 Sun Studio 12.2
NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
| sed -e 's/^.* Sun C \(.*\)/\1/'`
echo " + Sun C version: $NGX_SUNC_VER"
have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
cat << END > $NGX_AUTOTEST.c
int main() { printf("%d", __SUNPRO_C); }
END
eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
ngx_sunc_ver=`$NGX_AUTOTEST`
fi
rm -rf $NGX_AUTOTEST*
# 1424 == 0x590, Sun Studio 12
if [ "$ngx_sunc_ver" -ge 1424 ]; then
ngx_sparc32="-m32"
ngx_sparc64="-m64"
ngx_amd64="-m64"
else
ngx_sparc32="-xarch=v8plus"
ngx_sparc64="-xarch=v9"
ngx_amd64="-xarch=amd64"
fi
case "$NGX_MACHINE" in
i86pc)
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
;;
sun4u | sun4v)
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
;;
esac
# optimizations
# 20736 == 0x5100, Sun Studio 12.1
if [ "$ngx_sunc_ver" -ge 20736 ]; then
ngx_fast="-fast"
else
# older versions had problems with bit-fields
ngx_fast="-fast -xalias_level=any"
fi
IPO=-xipo
CFLAGS="$CFLAGS $ngx_fast $IPO"
CORE_LINK="$CORE_LINK $ngx_fast $IPO"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-xchip=pentium"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II
CPU_OPT="-xchip=pentium_pro"
;;
pentium3)
# optimize for Pentium III
CPU_OPT="-xchip=pentium3"
#CPU_OPT="$CPU_OPT -xarch=sse"
CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4"
;;
pentium4)
# optimize for Pentium 4
CPU_OPT="-xchip=pentium4"
#CPU_OPT="$CPU_OPT -xarch=sse2"
CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8"
;;
opteron)
# optimize for Opteron
CPU_OPT="-xchip=opteron"
#CPU_OPT="$CPU_OPT -xarch=sse2"
CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16"
;;
sparc32)
# build 32-bit UltraSparc binary
CPU_OPT="$ngx_sparc32"
CORE_LINK="$CORE_LINK $ngx_sparc32"
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32"
NGX_CPU_CACHE_LINE=64
;;
sparc64)
# build 64-bit UltraSparc binary
CPU_OPT="$ngx_sparc64"
CORE_LINK="$CORE_LINK $ngx_sparc64"
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64"
NGX_CPU_CACHE_LINE=64
;;
amd64)
# build 64-bit amd64 binary
CPU_OPT="$ngx_amd64"
CORE_LINK="$CORE_LINK $ngx_amd64"
CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64"
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
NGX_CPU_CACHE_LINE=64
;;
esac
CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="$ngx_fast $IPO $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="$ngx_fast $IPO $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="$ngx_fast $IPO $CPU_OPT"
fi
# stop on warning
CFLAGS="$CFLAGS -errwarn=%all"
# debug
CFLAGS="$CFLAGS -g"

View file

@ -0,0 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $have
#define $have $value
#endif
END

View file

@ -0,0 +1,45 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for system byte ordering ...$ngx_c"
echo >> $NGX_ERR
echo "checking for system byte ordering" >> $NGX_ERR
cat << END > $NGX_AUTOTEST.c
int main() {
int i = 0x11223344;
char *p;
p = (char *) &i;
if (*p == 0x44) return 0;
return 1;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
if $NGX_AUTOTEST >/dev/null 2>&1; then
echo " little endian"
have=NGX_HAVE_LITTLE_ENDIAN . auto/have
else
echo " big endian"
fi
rm -rf $NGX_AUTOTEST*
else
rm -rf $NGX_AUTOTEST*
echo
echo "$0: error: cannot detect system byte ordering"
exit 1
fi

View file

@ -0,0 +1,123 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_feature ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for $ngx_feature
END
ngx_found=no
if test -n "$ngx_feature_name"; then
ngx_have_feature=`echo $ngx_feature_name \
| tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
fi
if test -n "$ngx_feature_path"; then
for ngx_temp in $ngx_feature_path; do
ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
done
fi
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
$NGX_INCLUDE_UNISTD_H
$ngx_feature_incs
int main() {
$ngx_feature_test;
return 0;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
ngx_feature_inc_path=
eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
case "$ngx_feature_run" in
yes)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
echo " found"
ngx_found=yes
if test -n "$ngx_feature_name"; then
have=$ngx_have_feature . auto/have
fi
else
echo " found but is not working"
fi
;;
value)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
echo " found"
ngx_found=yes
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $ngx_feature_name
#define $ngx_feature_name `$NGX_AUTOTEST`
#endif
END
else
echo " found but is not working"
fi
;;
bug)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
echo " not found"
else
echo " found"
ngx_found=yes
if test -n "$ngx_feature_name"; then
have=$ngx_have_feature . auto/have
fi
fi
;;
*)
echo " found"
ngx_found=yes
if test -n "$ngx_feature_name"; then
have=$ngx_have_feature . auto/have
fi
;;
esac
else
echo " not found"
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*

12
Dengine/tengine/auto/have Normal file
View file

@ -0,0 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $have
#define $have 1
#endif
END

View file

@ -0,0 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_HEADERS_H
#ifndef $have
#define $have 1
#endif
END

View file

@ -0,0 +1,13 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_include="unistd.h"; . auto/include
ngx_include="inttypes.h"; . auto/include
ngx_include="limits.h"; . auto/include
ngx_include="sys/filio.h"; . auto/include
ngx_include="sys/param.h"; . auto/include
ngx_include="sys/mount.h"; . auto/include
ngx_include="sys/statvfs.h"; . auto/include
ngx_include="crypt.h"; . auto/include

View file

@ -0,0 +1,61 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_include ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for $ngx_include
END
ngx_found=no
cat << END > $NGX_AUTOTEST.c
$NGX_INCLUDE_SYS_PARAM_H
#include <$ngx_include>
int main() {
return 0;
}
END
ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
ngx_found=yes
echo " found"
ngx_name=`echo $ngx_include \
| tr abcdefghijklmnopqrstuvwxyz/. ABCDEFGHIJKLMNOPQRSTUVWXYZ__`
have=NGX_HAVE_$ngx_name . auto/have_headers
eval "NGX_INCLUDE_$ngx_name='#include <$ngx_include>'"
#STUB
eval "NGX_$ngx_name='#include <$ngx_include>'"
else
echo " not found"
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*

54
Dengine/tengine/auto/init Normal file
View file

@ -0,0 +1,54 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_MAKEFILE=$NGX_OBJS/Makefile
NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
NGX_AUTOTEST=$NGX_OBJS/autotest
NGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
# STUBs
NGX_ERR=$NGX_OBJS/autoconf.err
MAKEFILE=$NGX_OBJS/Makefile
# dso
NGX_DSO_COMPILE=$NGX_OBJS/dso_tool
NGX_MODULE_STUBS=$NGX_OBJS/module_stubs
NGX_PCH=
NGX_USE_PCH=
# check the echo's "-n" option and "\c" capability
if echo "test\c" | grep c >/dev/null; then
if echo -n test | grep n >/dev/null; then
ngx_n=
ngx_c=
else
ngx_n=-n
ngx_c=
fi
else
ngx_n=
ngx_c='\c'
fi
# create Makefile
cat << END > Makefile
default: build
clean:
rm -rf Makefile $NGX_OBJS
END

View file

@ -0,0 +1,362 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $USE_PERL = YES ]; then
cat << END >> $NGX_MAKEFILE
install_perl_modules:
cd $NGX_OBJS/src/http/modules/perl && \$(MAKE) install
END
NGX_INSTALL_PERL_MODULES=install_perl_modules
fi
case ".$NGX_SBIN_PATH" in
./*)
;;
.)
NGX_SBIN_PATH=$NGX_PREFIX/sbin/nginx
;;
*)
NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
;;
esac
case ".$NGX_CONF_PATH" in
./*)
;;
*)
NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
;;
esac
NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
case ".$NGX_PID_PATH" in
./*)
;;
*)
NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
;;
esac
case ".$NGX_ERROR_LOG_PATH" in
./* | .)
;;
*)
NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
;;
esac
case ".$NGX_HTTP_LOG_PATH" in
./*)
;;
*)
NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
;;
esac
case ".$NGX_DSO_PATH" in
./*)
;;
*)
NGX_DSO_PATH=$NGX_PREFIX/$NGX_DSO_PATH
;;
esac
case ".$NGX_DSO_TOOL_PATH" in
./*)
;;
*)
NGX_DSO_TOOL_PATH=$NGX_PREFIX/$NGX_DSO_TOOL_PATH
;;
esac
if test -f man/nginx.8 ; then
NGX_MAN=man/nginx.8
else
NGX_MAN=docs/man/nginx.8
fi
if test -d html ; then
NGX_HTML=html
else
NGX_HTML=docs/html
fi
cat << END >> $NGX_MAKEFILE
manpage: $NGX_OBJS/nginx.8
$NGX_OBJS/nginx.8: $NGX_MAN $NGX_AUTO_CONFIG_H
sed -e "s|%%PREFIX%%|$NGX_PREFIX|" \\
-e "s|%%PID_PATH%%|$NGX_PID_PATH|" \\
-e "s|%%CONF_PATH%%|$NGX_CONF_PATH|" \\
-e "s|%%ERROR_LOG_PATH%%|${NGX_ERROR_LOG_PATH:-stderr}|" \\
< $NGX_MAN > \$@
END
case ".$NGX_OBJS" in
./*)
NGX_TEST_BINARY=$NGX_OBJS/nginx
;;
*)
NGX_TEST_BINARY=`pwd`/$NGX_OBJS/nginx
;;
esac
cat << END >> $NGX_MAKEFILE
test: $NGX_OBJS/nginx
TEST_NGINX_BINARY=$NGX_TEST_BINARY prove -v -I `pwd`/tests/nginx-tests/nginx-tests/lib tests/nginx-tests/nginx-tests tests/nginx-tests/cases
END
if test -n "$NGX_SHARED_MODULES"; then
cat << END >> $NGX_MAKEFILE
dso_install: all
END
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)$NGX_DSO_PATH' \
|| mkdir -p '\$(DESTDIR)$NGX_DSO_PATH'
END
for ngx_shared_modules in $NGX_SHARED_MODULES
do
cat << END >> $NGX_MAKEFILE
test ! -f '\$(DESTDIR)$NGX_DSO_PATH$ngx_shared_modules${NGX_SOEXT}' \
|| unlink '\$(DESTDIR)$NGX_DSO_PATH$ngx_shared_modules${NGX_SOEXT}'
END
done
for ngx_dso_module in $NGX_DSO_ALL_TARGETS
do
cat << END >> $NGX_MAKEFILE
cp $ngx_dso_module \$(DESTDIR)$NGX_DSO_PATH
END
done
cat << END >> $NGX_MAKEFILE
install: all \
$NGX_INSTALL_PERL_MODULES
END
else
cat << END >> $NGX_MAKEFILE
install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
$NGX_INSTALL_PERL_MODULES
END
fi
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)$NGX_PREFIX' || mkdir -p '\$(DESTDIR)$NGX_PREFIX'
test -d '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' \
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`'
test ! -f '\$(DESTDIR)$NGX_SBIN_PATH' \
|| mv '\$(DESTDIR)$NGX_SBIN_PATH' \
'\$(DESTDIR)$NGX_SBIN_PATH.old'
cp $NGX_OBJS/nginx '\$(DESTDIR)$NGX_SBIN_PATH'
test -d '\$(DESTDIR)$NGX_CONF_PREFIX' \
|| mkdir -p '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/koi-win '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/koi-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/win-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types' \
|| cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params' \
|| cp conf/fastcgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/fastcgi_params \
'\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf' \
|| cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params' \
|| cp conf/uwsgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/uwsgi_params \
'\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params' \
|| cp conf/scgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/scgi_params \
'\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params.default'
test -f '\$(DESTDIR)$NGX_CONF_PATH' \
|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' || \
mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
test -d '\$(DESTDIR)$NGX_PREFIX/html' \
|| cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
END
if [ $HTTP_USER_AGENT = YES ] || [ $HTTP_USER_AGENT_SHARED = YES ]; then
cat << END >> $NGX_MAKEFILE
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/browsers' \
|| cp conf/browsers '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/browsers '\$(DESTDIR)$NGX_CONF_PREFIX/browsers'
END
fi
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' || \
mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`'
END
fi
if [ $NGX_DSO = YES ] ; then
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)$NGX_DSO_PATH' \
|| mkdir -p '\$(DESTDIR)$NGX_DSO_PATH'
END
for ngx_shared_modules in $NGX_SHARED_MODULES
do
cat << END >> $NGX_MAKEFILE
test ! -f '\$(DESTDIR)$NGX_DSO_PATH$ngx_shared_modules${NGX_SOEXT}' \
|| unlink '\$(DESTDIR)$NGX_DSO_PATH$ngx_shared_modules${NGX_SOEXT}'
END
done
for ngx_dso_module in $NGX_DSO_ALL_TARGETS
do
cat << END >> $NGX_MAKEFILE
cp $ngx_dso_module \$(DESTDIR)$NGX_DSO_PATH
END
done
cat << END >> $NGX_MAKEFILE
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/module_stubs' \
|| cp $NGX_MODULE_STUBS '\$(DESTDIR)$NGX_CONF_PREFIX'
cp $NGX_MODULE_STUBS '\$(DESTDIR)$NGX_CONF_PREFIX/module_stubs'
test -d '\$(DESTDIR)`dirname "$NGX_DSO_TOOL_PATH"`' || \
mkdir -p '\$(DESTDIR)`dirname "$NGX_DSO_TOOL_PATH"`'
cp $NGX_DSO_COMPILE '\$(DESTDIR)$NGX_DSO_TOOL_PATH'
chmod 0755 '\$(DESTDIR)$NGX_DSO_TOOL_PATH'
END
# nginx c header
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)$NGX_INCLUDE_PATH' \
|| mkdir -p '\$(DESTDIR)$NGX_INCLUDE_PATH'
END
for dep in $CORE_DEPS
do
if test -n "$dep"; then
cat << END >> $NGX_MAKEFILE
test -f '$dep' && cp '$dep' '\$(DESTDIR)$NGX_INCLUDE_PATH'
END
fi
done
for hdep in $HTTP_DEPS
do
if test -n "$hdep"; then
cat << END >> $NGX_MAKEFILE
test -f '$hdep' && cp '$hdep' '\$(DESTDIR)$NGX_INCLUDE_PATH'
END
fi
done
cat << END >> $NGX_MAKEFILE
test -f '$NGX_OBJS/ngx_auto_headers.h' && cp '$NGX_OBJS/ngx_auto_headers.h' '\$(DESTDIR)$NGX_INCLUDE_PATH'
test -f '$NGX_OBJS/ngx_auto_config.h' && cp '$NGX_OBJS/ngx_auto_config.h' '\$(DESTDIR)$NGX_INCLUDE_PATH'
END
fi
# create Makefile
cat << END >> Makefile
build:
\$(MAKE) -f $NGX_MAKEFILE
\$(MAKE) -f $NGX_MAKEFILE manpage
test:
\$(MAKE) -f $NGX_MAKEFILE test
install:
\$(MAKE) -f $NGX_MAKEFILE install
dso_install:
\$(MAKE) -f $NGX_MAKEFILE dso_install
upgrade:
$NGX_SBIN_PATH -t
kill -USR2 \`cat $NGX_PID_PATH\`
sleep 1
test -f $NGX_PID_PATH.oldbin
kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
END

684
Dengine/tengine/auto/make Normal file
View file

@ -0,0 +1,684 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if test -n "$NGX_SHARED_MODULES"; then
if [ $NGX_DSO != YES ]; then
cat << END
you should enable dso, if you want to use a dynamically loaded module.
END
exit 1
fi
fi
echo "creating $NGX_MAKEFILE"
mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \
$NGX_OBJS/src/os/unix $NGX_OBJS/src/os/win32 \
$NGX_OBJS/src/http $NGX_OBJS/src/http/modules \
$NGX_OBJS/src/http/modules/perl \
$NGX_OBJS/modules/ngx_http_lua_module/src \
$NGX_OBJS/src/http/modules/tfs \
$NGX_OBJS/src/mail \
$NGX_OBJS/src/misc \
$NGX_OBJS/src/proc \
$NGX_OBJS/modules
ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
case ".$NGX_INCLUDE_PATH" in
./*)
;;
.)
NGX_INCLUDE_PATH=$NGX_PREFIX/include
;;
*)
NGX_INCLUDE_PATH=$NGX_PREFIX/$NGX_INCLUDE_PATH
;;
esac
cat << END > $NGX_MAKEFILE
CC = $CC
CFLAGS = $CFLAGS
CPP = $CPP
LINK = $LINK
END
if test -n "$NGX_PERL_CFLAGS"; then
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
fi
# ALL_INCS, required by the addons and by OpenWatcom C precompiled headers
ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS\
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
ALL_INCS = $ngx_include_opt$ngx_incs
END
dso_all_incs=$ngx_include_opt$ngx_incs
ngx_all_srcs="$CORE_SRCS"
# the core dependences and include paths
ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_incs=`echo $CORE_INCS $NGX_OBJS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
CORE_DEPS = $ngx_deps
CORE_INCS = $ngx_include_opt$ngx_incs
END
dso_core_deps=$ngx_deps
dso_core_incs=$ngx_include_opt$ngx_incs
# the http dependences and include paths
if [ $HTTP = YES ]; then
ngx_all_srcs="$ngx_all_srcs $HTTP_SRCS"
ngx_deps=`echo $HTTP_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_incs=`echo $HTTP_INCS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
HTTP_DEPS = $ngx_deps
HTTP_INCS = $ngx_include_opt$ngx_incs
END
dso_http_deps=$ngx_deps
dso_http_incs=$ngx_include_opt$ngx_incs
fi
# the mail dependences and include paths
if [ $MAIL = YES ]; then
ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS"
ngx_deps=`echo $MAIL_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_incs=`echo $MAIL_INCS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
MAIL_DEPS = $ngx_deps
MAIL_INCS = $ngx_include_opt$ngx_incs
END
fi
ngx_all_srcs="$ngx_all_srcs $NGX_MISC_SRCS"
if test -n "$NGX_ADDON_SRCS"; then
cat << END >> $NGX_MAKEFILE
ADDON_DEPS = \$(CORE_DEPS) $NGX_ADDON_DEPS
END
fi
# nginx
ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"`
for ngx_src in $NGX_ADDON_SRCS
do
ngx_obj="addon/`basename \`dirname $ngx_src\``"
test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj
ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
| sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_all_srcs="$ngx_all_srcs $ngx_obj"
done
ngx_all_objs=`echo $ngx_all_srcs \
| sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_modules_obj=`echo $ngx_modules_c | sed -e "s/\(.*\.\)c/\1$ngx_objext/"`
if test -n "$NGX_RES"; then
ngx_res=$NGX_RES
else
ngx_res="$NGX_RC $NGX_ICONS"
ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
fi
ngx_deps=`echo $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
if test -n "$NGX_LD_OPT$CORE_LIBS"; then
ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
fi
ngx_link=${CORE_LINK:+`echo $CORE_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
for ngx_shared_modules in $NGX_SHARED_MODULES
do
NGX_DSO_ALL_TARGETS="$NGX_DSO_ALL_TARGETS $NGX_OBJS${ngx_dirsep}modules${ngx_dirsep}${ngx_shared_modules}${NGX_SOEXT}"
done
if test -n "$NGX_DSO_ALL_TARGETS"; then
ngx_dso_target=`echo $NGX_DSO_ALL_TARGETS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
all: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} $ngx_dso_target
END
fi
cat << END >> $NGX_MAKEFILE
$NGX_OBJS${ngx_dirsep}nginx${ngx_binext}: $ngx_deps$ngx_spacer
\$(LINK) ${ngx_long_start}${ngx_binout}$NGX_OBJS${ngx_dirsep}nginx$ngx_long_cont$ngx_objs$ngx_libs$ngx_link$NGX_EXTEND_LD_OPT
$ngx_rcc
${ngx_long_end}
END
# ngx_modules.c
if test -n "$NGX_PCH"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS)"
fi
cat << END >> $NGX_MAKEFILE
$ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
$ngx_cc$ngx_tab$ngx_objout$ngx_modules_obj$ngx_tab$ngx_modules_c$NGX_AUX
END
# the core sources
for ngx_src in $CORE_SRCS
do
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
# the http sources
if [ $HTTP = YES ]; then
if test -n "$NGX_PCH"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
fi
for ngx_source in $HTTP_SRCS
do
ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
$ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
else
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
fi
done
fi
# the mail sources
if [ $MAIL = YES ]; then
if test -n "$NGX_PCH"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(MAIL_INCS)"
fi
for ngx_src in $MAIL_SRCS
do
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) \$(MAIL_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
fi
# the misc sources
if test -n "$NGX_MISC_SRCS"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
for ngx_src in $NGX_MISC_SRCS
do
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) $ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
fi
# the addons sources
if test -n "$NGX_ADDON_SRCS"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
for ngx_src in $NGX_ADDON_SRCS
do
ngx_obj="addon/`basename \`dirname $ngx_src\``"
ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
| sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_obj \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
fi
# the addons config.make
if test -n "$NGX_ADDONS"; then
for ngx_addon_dir in $NGX_ADDONS
do
if test -f $ngx_addon_dir/config.make; then
. $ngx_addon_dir/config.make
fi
done
fi
# Win32 resource file
if test -n "$NGX_RES"; then
ngx_res=`echo "$NGX_RES: $NGX_RC $NGX_ICONS" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
$ngx_res
$ngx_rcc
END
fi
# the precompiled headers
if test -n "$NGX_PCH"; then
echo "#include <ngx_config.h>" > $NGX_OBJS/ngx_pch.c
ngx_pch="src/core/ngx_config.h $OS_CONFIG $NGX_OBJS/ngx_auto_config.h"
ngx_pch=`echo "$NGX_PCH: $ngx_pch" | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_src="\$(CC) \$(CFLAGS) $NGX_BUILD_PCH $ngx_compile_opt \$(ALL_INCS)"
ngx_src="$ngx_src $ngx_objout$NGX_OBJS/ngx_pch.obj $NGX_OBJS/ngx_pch.c"
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
$ngx_pch
$ngx_src
END
fi
if [ $NGX_DSO = YES ] ; then
ngx_dso_cflag=" -fPIC "
ngx_dso_link_flag=" -shared "
ngx_dso_index=2
case "$NGX_PLATFORM" in
Darwin:*)
ngx_dso_link_flag="$ngx_dso_link_flag -undefined dynamic_lookup "
esac
echo "#include<ngx_shared_config.h>" >> objs/ngx_auto_config.h
echo "" > objs/ngx_shared_config.h
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
for ngx_shared_modules in $NGX_SHARED_MODULES
do
ngx_dso_all_objs=
ngx_dso_srcs=`echo $NGX_SHARED_SRCS \
| awk -v dso_index=$ngx_dso_index 'BEGIN { FS="|" } {print $dso_index}'`
for ngx_source in $ngx_dso_srcs
do
ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
ngx_dso_all_objs="$ngx_dso_all_objs $ngx_obj"
done
ngx_dso_feture_path=`echo $DSO_INCS | awk 'BEGIN { FS="|" } \
{for (i=1; i<=NF; i++) print $i}' | awk -v module_name=$ngx_shared_modules \
'BEGIN { FS=":"} {if ($1 == module_name) print $2}'`
ngx_dso_incs=`echo $ngx_dso_feture_path \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
for ngx_source in $ngx_dso_srcs
do
ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_dso_cflag $ngx_dso_incs$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
ngx_dso_deps=`echo $ngx_dso_all_objs $ngx_res $LINK_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_dso_objs=`echo $ngx_dso_all_objs \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_dso_link=${CORE_LINK:+`echo $CORE_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
ngx_dso_feture_lib=`echo $DSO_LIBS | awk 'BEGIN { FS="|" } \
{for (i=1; i<=NF; i++) print $i}' | awk -v module_name=$ngx_shared_modules \
'BEGIN { FS=":"} {if ($1 == module_name) print $2}'`
cat << END >> $NGX_MAKEFILE
$NGX_OBJS${ngx_dirsep}modules${ngx_dirsep}${ngx_shared_modules}${NGX_SOEXT}: $ngx_dso_deps$ngx_spacer
\$(LINK)${ngx_dso_link_flag} ${ngx_long_start}${ngx_binout} $NGX_OBJS/modules${ngx_dirsep}${ngx_shared_modules}${NGX_SOEXT}$ngx_long_cont$ngx_dso_objs$ngx_libs$ngx_dso_link $ngx_dso_feture_lib
$ngx_rcc
${ngx_long_end}
END
ngx_dso_index=$(($ngx_dso_index+1))
done
core_deps_temp=
core_incs_temp=
http_deps_temp=
http_incs_temp=
all_incs_temp=
for dai in $dso_all_incs
do
case ".$dai" in
.src/*)
;;
.\\)
all_incs_temp="$all_incs_temp \\"
;;
.-I)
;;
.*)
all_incs_temp="$all_incs_temp -I$dai"
;;
esac
done
for cdep in $dso_core_deps
do
if test -n "$cdep"; then
cdep=`echo "$cdep" | awk 'BEGIN {FS="/"} {print $NF}'`
core_deps_temp="$core_deps_temp $NGX_INCLUDE_PATH/$cdep"
fi
done
for dci in $dso_core_incs
do
if [ "$dci" = "-I" ]; then
core_incs_temp="$core_incs_temp $dci"
elif [ "$dci" = "\\" ]; then
core_incs_temp="$core_incs_temp \\"
elif test -n "$dci"; then
core_incs_temp="$core_incs_temp $dci"
fi
done
for hdep in $dso_http_deps
do
if test -n "$hdep"; then
hdep=`echo "$hdep" | awk 'BEGIN {FS="/"} {print $NF}'`
http_deps_temp="$http_deps_temp $hdep"
fi
done
for dhi in $dso_http_incs
do
if [ "$dhi" = "-I" ]; then
http_incs_temp="$http_incs_temp $dhi"
elif [ "$dhi" = "\\" ]; then
http_incs_temp="$http_incs_temp \\"
elif test -n "$dhi"; then
http_incs_temp="$http_incs_temp $dhi"
fi
done
ngx_feature_file=`cat auto/feature | sed -e 's/\`/\\\`/g' | sed -e 's/\n/\\n/g'`
ngx_have_file=`cat auto/have | sed -e 's/\n/\\n/g'`
ngx_feature_file=\'$ngx_feature_file\'
ngx_have_file=\'$ngx_have_file\'
cat << END > $NGX_DSO_COMPILE
#!/bin/sh
# Copyright (C) 2010-2015 Alibaba Group Holding Limited
ngx_soext='$NGX_SOEXT'
CC=$CC
CFLAGS='$CFLAGS -fPIC'
CPP='$CPP'
LINK='$LINK -fPIC $ngx_dso_link_flag '
NGX_INCLUDE_PATH=$NGX_INCLUDE_PATH
CORE_LIBS='$CORE_LIBS'
CORE_LINK='$ngx_link'
NGX_LD_OPT='$NGX_LD_OPT'
NGX_PREFIX=$NGX_PREFIX
NGX_RPATH=$NGX_RPATH
ngx_regex_dirsep='$ngx_regex_dirsep'
ngx_cont='$ngx_cont'
ngx_cc='$ngx_cc'
ngx_tab='$ngx_tab'
ngx_objout='$ngx_objout'
NGX_AUX='$NGX_AUX'
ngx_long_regex_cont='$ngx_long_regex_cont'
ngx_dirsep='$ngx_dirsep'
ngx_binext='$ngx_binext'
ngx_long_start='$ngx_long_start'
ngx_long_cont='$ngx_long_cont'
ngx_rcc='$ngx_rcc'
ngx_spacer='$ngx_spacer'
ngx_objext='$ngx_objext'
ngx_regex_cont='$ngx_regex_cont'
ngx_include_opt='$ngx_include_opt'
ngx_binout='$ngx_binout'
NGX_DSO_PATH=$NGX_DSO_PATH
NGX_AUTOCONF_ERR=autoconf.err
NGX_AUTOTEST=autotest
NGX_AUTO_CONFIG_H='objs/ngx_shared_config.h'
NGX_CONFIGURE="$NGX_CONFIGURE"
ngx_feature_file=$ngx_feature_file
ngx_have_file=$ngx_have_file
END
sed -e "s|%%ALL_INCS%%|'$all_incs_temp'|g" \
-e "s|%%CORE_DEPS%%|'$core_deps_temp'|g" \
-e "s|%%CORE_INCS%%|'$core_incs_temp'|g" \
-e "s|%%HTTP_DEPS%%|'$http_deps_temp'|g" \
-e "s|%%HTTP_INCS%%|'$http_incs_temp'|g" \
contrib/dso.in >> $NGX_DSO_COMPILE
fi

View file

@ -0,0 +1,950 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
EVENT_SELECT=YES
fi
if [ $EVENT_SELECT = YES ]; then
have=NGX_HAVE_SELECT . auto/have
CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
fi
if [ $EVENT_POLL = NO -a $EVENT_FOUND = NO ]; then
EVENT_POLL=YES
fi
if [ $EVENT_POLL = YES ]; then
have=NGX_HAVE_POLL . auto/have
CORE_SRCS="$CORE_SRCS $POLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $POLL_MODULE"
fi
if [ $NGX_TEST_BUILD_DEVPOLL = YES ]; then
have=NGX_HAVE_DEVPOLL . auto/have
have=NGX_TEST_BUILD_DEVPOLL . auto/have
EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
fi
if [ $NGX_TEST_BUILD_EVENTPORT = YES ]; then
have=NGX_HAVE_EVENTPORT . auto/have
have=NGX_TEST_BUILD_EVENTPORT . auto/have
EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
fi
if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
have=NGX_HAVE_EPOLL . auto/have
have=NGX_HAVE_EPOLLRDHUP . auto/have
have=NGX_HAVE_EVENTFD . auto/have
have=NGX_TEST_BUILD_EPOLL . auto/have
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
fi
if [ $NGX_TEST_BUILD_RTSIG = YES ]; then
have=NGX_HAVE_RTSIG . auto/have
have=NGX_TEST_BUILD_RTSIG . auto/have
EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
fi
if [ $NGX_TEST_BUILD_SOLARIS_SENDFILEV = YES ]; then
have=NGX_TEST_BUILD_SOLARIS_SENDFILEV . auto/have
CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
fi
if [ $NGX_DSO = YES ] ; then
have=NGX_DSO . auto/have
have=NGX_DSO_MAX value="$NGX_DSO_MAX" . auto/define
have=NGX_DSO_PATH value="\"$NGX_DSO_PATH\"" . auto/define
have=NGX_SOEXT value="\"$NGX_SOEXT\"" . auto/define
CORE_MODULES="$CORE_MODULES $DSO_MODULE"
CORE_SRCS="$CORE_SRCS $DSO_SRCS"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
LINK="$LINK -rdynamic"
fi
if [ $PROCS = YES ]; then
have=NGX_PROCS . auto/have
CORE_SRCS="$CORE_SRCS $PROCS_SRCS"
CORE_DEPS="$CORE_DEPS $PROCS_DEPS"
CORE_INCS="$CORE_INCS $PROCS_INCS"
else
PROCS_MODULES=
fi
if [ $HTTP != YES ]; then
have=NGX_CRYPT . auto/nohave
CRYPT_LIB=
fi
if [ $HTTP_CACHE = YES ]; then
USE_MD5=YES
have=NGX_HTTP_CACHE . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_CACHE_TAG))
HTTP_SRCS="$HTTP_SRCS $HTTP_FILE_CACHE_SRCS"
fi
if [ $HTTP_SSI = YES ]; then
HTTP_POSTPONE=YES
fi
if [ $HTTP_ADDITION = YES ]; then
HTTP_POSTPONE=YES
fi
# the module order is important
# ngx_http_static_module
# ngx_http_gzip_static_module
# ngx_http_dav_module
# ngx_http_autoindex_module
# ngx_http_index_module
# ngx_http_random_index_module
# ngx_http_concat_module
#
# ngx_http_access_module
# ngx_http_realip_module
#
#
# the filter order is important
# ngx_http_write_filter
# ngx_http_header_filter
# ngx_http_chunked_filter
# ngx_http_spdy_filter
# ngx_http_range_header_filter
# ngx_http_gzip_filter
# ngx_http_postpone_filter
# ngx_http_ssi_filter
# ngx_http_charset_filter
# ngx_http_xslt_filter
# ngx_http_image_filter
# ngx_http_sub_filter
# ngx_http_addition_filter
# ngx_http_gunzip_filter
# ngx_http_userid_filter
# ngx_http_footer_filter
# ngx_http_trim_filter
# ngx_http_headers_filter
# ngx_http_copy_filter
# ngx_http_range_body_filter
# ngx_http_not_modified_filter
HTTP_FILTER_MODULES="$HTTP_WRITE_FILTER_MODULE \
$HTTP_HEADER_FILTER_MODULE \
$HTTP_CHUNKED_FILTER_MODULE"
if [ $HTTP_SPDY = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SPDY_FILTER_MODULE"
fi
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE"
if [ $HTTP_GZIP = YES ]; then
have=NGX_HTTP_GZIP . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_GZIP_TAG))
USE_ZLIB=YES
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GZIP_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_SRCS"
fi
if [ $HTTP_POSTPONE = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
fi
if [ $HTTP_SSI = YES ]; then
have=NGX_HTTP_SSI . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_SSI_TAG))
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
fi
if [ $HTTP_CHARSET = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS"
fi
if [ $HTTP_CHARSET_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_CHARSET_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_CHARSET_SRCS"
fi
if [ $HTTP_XSLT = YES ]; then
USE_LIBXSLT=YES
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_XSLT_SRCS"
fi
if [ $HTTP_XSLT_SHARED = YES ]; then
USE_LIBXSLT=YES
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_XSLT_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_XSLT_SRCS"
fi
if [ $HTTP_IMAGE_FILTER = YES ]; then
USE_LIBGD=YES
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_IMAGE_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_IMAGE_SRCS"
fi
if [ $HTTP_IMAGE_FILTER_SHARED = YES ]; then
USE_LIBGD=YES
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_IMAGE_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_IMAGE_SRCS"
fi
if [ $HTTP_SUB = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SUB_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SUB_SRCS"
fi
if [ $HTTP_SUB_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SUB_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SUB_SRCS"
fi
if [ $HTTP_ADDITION = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_ADDITION_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_ADDITION_SRCS"
fi
if [ $HTTP_ADDITION_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_ADDITION_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_ADDITION_SRCS"
fi
if [ $HTTP_GUNZIP = YES ]; then
have=NGX_HTTP_GZIP . auto/have
USE_ZLIB=YES
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GUNZIP_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GUNZIP_SRCS"
fi
if [ $HTTP_USERID = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_USERID_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_USERID_SRCS"
fi
if [ $HTTP_SPDY = YES ]; then
have=NGX_HTTP_SPDY . auto/have
USE_ZLIB=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_SPDY_MODULE"
HTTP_DEPS="$HTTP_DEPS $HTTP_SPDY_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_SPDY_SRCS"
fi
if [ $HTTP_USERID_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_USERID_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_USERID_SRCS"
fi
if [ $HTTP_FOOTER = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_FOOTER_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_FOOTER_FILTER_SRCS"
fi
if [ $HTTP_FOOTER_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_FOOTER_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_FOOTER_FILTER_SRCS"
fi
if [ $HTTP_TRIM = YES ]; then
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_TRIM_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_TRIM_FILTER_SRCS"
fi
if [ $HTTP_TRIM_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_TRIM_FILTER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_TRIM_FILTER_SRCS"
fi
HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE"
if [ $HTTP_GZIP_STATIC = YES ]; then
have=NGX_HTTP_GZIP . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_GZIP_STATIC_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_GZIP_STATIC_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_STATIC_SRCS"
fi
if [ $HTTP_DAV = YES ]; then
have=NGX_HTTP_DAV . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_DAV_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_DAV_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_DAV_SRCS"
fi
if [ $HTTP_AUTOINDEX = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_AUTOINDEX_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_AUTOINDEX_SRCS"
fi
if [ $HTTP_AUTOINDEX_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_AUTOINDEX_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_AUTOINDEX_SRCS"
fi
HTTP_MODULES="$HTTP_MODULES $HTTP_INDEX_MODULE"
if [ $HTTP_RANDOM_INDEX = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_RANDOM_INDEX_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_RANDOM_INDEX_SRCS"
fi
if [ $HTTP_RANDOM_INDEX_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_RANDOM_INDEX_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_RANDOM_INDEX_SRCS"
fi
if [ $HTTP_CONCAT = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_CONCAT_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_CONCAT_SRCS"
fi
if [ $HTTP_CONCAT_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_CONCAT_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_CONCAT_SRCS"
fi
if [ $HTTP_AUTH_REQUEST = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_REQUEST_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_REQUEST_SRCS"
fi
if [ $HTTP_AUTH_BASIC = YES ]; then
USE_MD5=YES
USE_SHA1=YES
have=NGX_CRYPT . auto/have
HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_BASIC_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_BASIC_SRCS"
CORE_LIBS="$CORE_LIBS $CRYPT_LIB"
fi
if [ $HTTP_ACCESS = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_ACCESS_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_ACCESS_SRCS"
fi
if [ $HTTP_ACCESS_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_ACCESS_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_ACCESS_SRCS"
fi
if [ $HTTP_LIMIT_CONN = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_CONN_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_CONN_SRCS"
fi
if [ $HTTP_LIMIT_CONN_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_LIMIT_CONN_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_LIMIT_CONN_SRCS"
fi
if [ $HTTP_LIMIT_REQ = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_REQ_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_REQ_SRCS"
fi
if [ $HTTP_LIMIT_REQ_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_LIMIT_REQ_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_LIMIT_REQ_SRCS"
fi
if [ $HTTP_REALIP = YES ]; then
have=NGX_HTTP_REALIP . auto/have
have=NGX_HTTP_X_FORWARDED_FOR . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_REALIP_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_REALIP_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_REALIP_SRCS"
fi
if [ $HTTP_STATUS = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_STATUS_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_STATUS_SRCS"
fi
if [ $HTTP_STATUS_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_STATUS_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_STATUS_SRCS"
fi
if [ $HTTP_GEO = YES ]; then
have=NGX_HTTP_X_FORWARDED_FOR . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_GEO_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_GEO_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GEO_SRCS"
fi
if [ $HTTP_GEOIP = YES ]; then
have=NGX_HTTP_X_FORWARDED_FOR . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_GEOIP_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_GEOIP_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GEOIP_SRCS"
fi
if [ $HTTP_GEOIP_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_GEOIP_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_GEOIP_SRCS"
fi
if [ $HTTP_MAP = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_MAP_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_MAP_SRCS"
fi
if [ $HTTP_MAP_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_MAP_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_MAP_SRCS"
fi
if [ $HTTP_SPLIT_CLIENTS = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_SPLIT_CLIENTS_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SPLIT_CLIENTS_SRCS"
fi
if [ $HTTP_SPLIT_CLIENTS_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SPLIT_CLIENTS_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SPLIT_CLIENTS_SRCS"
fi
if [ $HTTP_REFERER = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_REFERER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_REFERER_SRCS"
fi
if [ $HTTP_REFERER_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_REFERER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_REFERER_SRCS"
fi
if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then
USE_PCRE=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_REWRITE_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_REWRITE_SRCS"
fi
if [ $HTTP_REWRITE_SHARED = YES -a $USE_PCRE != DISABLED ]; then
USE_PCRE=YES
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_REWRITE_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_REWRITE_SRCS"
fi
if [ $HTTP_SSL = YES ]; then
USE_OPENSSL=YES
have=NGX_HTTP_SSL . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_SSL_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_SSL_MODULE"
HTTP_DEPS="$HTTP_DEPS $HTTP_SSL_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS"
fi
if [ $HTTP_PROXY = YES ]; then
have=NGX_HTTP_X_FORWARDED_FOR . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_PROXY_TAG))
#USE_MD5=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_PROXY_SRCS"
fi
if [ $HTTP_FASTCGI = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_FASTCGI_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_FASTCGI_SRCS"
fi
if [ $HTTP_FASTCGI_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_FASTCGI_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_FASTCGI_SRCS"
fi
if [ $HTTP_UWSGI = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UWSGI_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UWSGI_SRCS"
fi
if [ $HTTP_UWSGI_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_UWSGI_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_UWSGI_SRCS"
fi
if [ $HTTP_SCGI = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_SCGI_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SCGI_SRCS"
fi
if [ $HTTP_SCGI_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SCGI_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SCGI_SRCS"
fi
if [ $HTTP_PERL = YES ]; then
USE_PERL=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_PERL_MODULE"
HTTP_INCS="$HTTP_INCS $HTTP_PERL_INCS"
HTTP_DEPS="$HTTP_DEPS $HTTP_PERL_DEPS"
HTTP_SRCS="$HTTP_SRCS $HTTP_PERL_SRCS"
fi
if [ $HTTP_LUA = YES ]; then
NGX_ADDONS="$NGX_ADDONS modules/ngx_http_lua_module"
fi
if [ $HTTP_LUA_SHARED = YES ]; then
USE_MD5=YES
USE_SHA1=YES
CORE_INCS="$CORE_INCS modules/ngx_http_lua_module/src/api"
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $NGX_HTTP_LUA_MODULE"
HTTP_DEPS="$HTTP_DEPS $NGX_HTTP_LUA_MODULE_DEPS"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$NGX_HTTP_LUA_MODULE_SRCS"
fi
if [ $HTTP_TFS = YES ]; then
USE_MD5=YES
CORE_INCS="$CORE_INCS src/http/modules/tfs"
HTTP_MODULES="$HTTP_MODULES $NGX_HTTP_TFS_MODULE"
HTTP_DEPS="$HTTP_DEPS $NGX_HTTP_TFS_MODULE_DEPS"
HTTP_SRCS="$HTTP_SRCS $NGX_HTTP_TFS_MODULE_SRCS"
fi
if [ $HTTP_TFS_SHARED = YES ]; then
USE_MD5=YES
CORE_INCS="$CORE_INCS src/http/modules/tfs"
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $NGX_HTTP_TFS_MODULE"
HTTP_DEPS="$HTTP_DEPS $NGX_HTTP_TFS_MODULE_DEPS"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$NGX_HTTP_TFS_MODULE_SRCS"
fi
if [ $HTTP_MEMCACHED = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_MEMCACHED_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_MEMCACHED_SRCS"
fi
if [ $HTTP_MEMCACHED_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_MEMCACHED_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_MEMCACHED_SRCS"
fi
if [ $HTTP_EMPTY_GIF = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_EMPTY_GIF_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_EMPTY_GIF_SRCS"
fi
if [ $HTTP_EMPTY_GIF_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_EMPTY_GIF_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_EMPTY_GIF_SRCS"
fi
if [ $HTTP_BROWSER = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_BROWSER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_BROWSER_SRCS"
fi
if [ $HTTP_BROWSER_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_BROWSER_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_BROWSER_SRCS"
fi
if [ $HTTP_USER_AGENT = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_USER_AGENT_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_USER_AGENT_SRCS"
fi
if [ $HTTP_USER_AGENT_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_USER_AGENT_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_USER_AGENT_SRCS"
fi
if [ $HTTP_SECURE_LINK = YES ]; then
USE_MD5=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_SECURE_LINK_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SECURE_LINK_SRCS"
fi
if [ $HTTP_SECURE_LINK_SHARED = YES ]; then
USE_MD5=YES
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SECURE_LINK_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SECURE_LINK_SRCS"
fi
if [ $HTTP_DEGRADATION = YES ]; then
have=NGX_HTTP_DEGRADATION . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_DEGRADATION_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_DEGRADATION_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_DEGRADATION_SRCS"
fi
if [ $HTTP_SYSGUARD = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_SYSGUARD_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SYSGUARD_SRCS"
fi
if [ $HTTP_SYSGUARD_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SYSGUARD_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SYSGUARD_SRCS"
fi
if [ $HTTP_FLV = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_FLV_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_FLV_SRCS"
fi
if [ $HTTP_FLV_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_FLV_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_FLV_SRCS"
fi
if [ $HTTP_SLICE = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_SLICE_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SLICE_SRCS"
fi
if [ $HTTP_SLICE_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_SLICE_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_SLICE_SRCS"
fi
if [ $HTTP_MP4 = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_MP4_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_MP4_SRCS"
fi
if [ $HTTP_MP4_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_MP4_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_MP4_SRCS"
fi
if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_IP_HASH_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"
fi
if [ $HTTP_UPSTREAM_IP_HASH_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_UPSTREAM_IP_HASH_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_UPSTREAM_IP_HASH_SRCS"
fi
if [ $HTTP_UPSTREAM_CONSISTENT_HASH = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_CONSISTENT_HASH_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_CONSISTENT_HASH_SRCS"
fi
if [ $HTTP_UPSTREAM_CONSISTENT_HASH_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_UPSTREAM_CONSISTENT_HASH_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_UPSTREAM_CONSISTENT_HASH_SRCS"
fi
if [ $HTTP_UPSTREAM_CHECK = YES ]; then
have=NGX_HTTP_UPSTREAM_CHECK . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_UPSTREAM_CHECK_TAG))
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_CHECK_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_CHECK_SRCS"
fi
if [ $HTTP_UPSTREAM_LEAST_CONN = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_LEAST_CONN_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_LEAST_CONN_SRCS"
fi
if [ $HTTP_UPSTREAM_LEAST_CONN_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_UPSTREAM_LEAST_CONN_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_UPSTREAM_LEAST_CONN_SRCS"
fi
if [ $HTTP_UPSTREAM_SESSION_STICKY = YES ]; then
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $HTTP_UPSTREAM_SESSION_STICKY_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_SESSION_STICKY_SRCS"
fi
if [ $HTTP_UPSTREAM_SESSION_STICKY_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_UPSTREAM_SESSION_STICKY_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_UPSTREAM_SESSION_STICKY_SRCS"
fi
if [ $HTTP_REQ_STATUS = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_REQ_STATUS_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_REQ_STATUS_SRCS"
HTTP_DEPS="$HTTP_DEPS $HTTP_REQ_STATUS_DEPS"
fi
if [ $HTTP_REQ_STATUS_SHARED = YES ]; then
NGX_SHARED_MODULES="$NGX_SHARED_MODULES $HTTP_REQ_STATUS_MODULE"
NGX_SHARED_SRCS="$NGX_SHARED_SRCS|$HTTP_REQ_STATUS_SRCS"
HTTP_DEPS="$HTTP_DEPS $HTTP_REQ_STATUS_DEPS"
fi
if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_KEEPALIVE_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_KEEPALIVE_SRCS"
fi
if [ $HTTP_UPSTREAM_DYNAMIC = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_DYNAMIC_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_DYNAMIC_SRCS"
fi
if [ $HTTP_DYNAMIC_UPSTREAM = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_DYUPS_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_DYUPS_SRCS"
if [ $HTTP_DYNAMIC_UPSTREAM_LUA = YES ]; then
HTTP_SRCS="$HTTP_SRCS $HTTP_DYUPS_LUA_SRCS"
HTTP_DEPS="$HTTP_DEPS $HTTP_DYUPS_LUA_DEPS"
have=NGX_DYUPS_LUA . auto/have
fi
fi
if [ $HTTP_STUB_STATUS = YES ]; then
have=NGX_STAT_STUB . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_STAT_STUB_TAG))
HTTP_MODULES="$HTTP_MODULES ngx_http_stub_status_module"
HTTP_SRCS="$HTTP_SRCS src/http/modules/ngx_http_stub_status_module.c"
fi
if [ $HTTP_UPSTREAM_RBTREE = YES ]; then
have=NGX_HTTP_UPSTREAM_RBTREE . auto/have
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_UPSTREAM_RBTREE_TAG))
fi
#if [ -r $NGX_OBJS/auto ]; then
# . $NGX_OBJS/auto
#fi
if test -n "$NGX_ADDONS"; then
echo configuring additional modules
for ngx_addon_dir in $NGX_ADDONS
do
echo "adding module in $ngx_addon_dir"
if test -f $ngx_addon_dir/config; then
. $ngx_addon_dir/config
echo " + $ngx_addon_name was configured"
else
echo "$0: error: no $ngx_addon_dir/config was found"
exit 1
fi
done
fi
if [ $MAIL_SSL = YES ]; then
have=NGX_MAIL_SSL . auto/have
USE_OPENSSL=YES
fi
if [ $NGX_SYSLOG = YES ]; then
CORE_MODULES="$CORE_MODULES ngx_syslog_module"
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_SYSLOG_TAG))
fi
modules="$CORE_MODULES $EVENT_MODULES $PROCS_MODULES"
if [ $USE_OPENSSL = YES ]; then
modules="$modules $OPENSSL_MODULE"
CORE_DEPS="$CORE_DEPS $OPENSSL_DEPS"
CORE_SRCS="$CORE_SRCS $OPENSSL_SRCS"
fi
if [ $USE_PCRE = YES ]; then
modules="$modules $REGEX_MODULE"
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
fi
if [ $HTTP = YES ]; then
modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
$HTTP_HEADERS_FILTER_MODULE \
$HTTP_AUX_FILTER_MODULES \
$HTTP_COPY_FILTER_MODULE \
$HTTP_RANGE_BODY_FILTER_MODULE \
$HTTP_NOT_MODIFIED_FILTER_MODULE"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)"
NGX_DSO_ABI_COMPATIBILITY=$(($NGX_DSO_ABI_COMPATIBILITY|$NGX_DSO_HTTP_TAG))
fi
if [ $NGX_DSO = YES ] ; then
have=NGX_DSO_ABI_COMPATIBILITY value="$NGX_DSO_ABI_COMPATIBILITY" . auto/define
else
have=NGX_DSO_ABI_COMPATIBILITY value="0" . auto/define
fi
if [ $MAIL = YES ]; then
modules="$modules $MAIL_MODULES"
if [ $MAIL_SSL = YES ]; then
modules="$modules $MAIL_SSL_MODULE"
MAIL_DEPS="$MAIL_DEPS $MAIL_SSL_DEPS"
MAIL_SRCS="$MAIL_SRCS $MAIL_SSL_SRCS"
fi
if [ $MAIL_POP3 = YES ]; then
modules="$modules $MAIL_POP3_MODULE"
MAIL_DEPS="$MAIL_DEPS $MAIL_POP3_DEPS"
MAIL_SRCS="$MAIL_SRCS $MAIL_POP3_SRCS"
fi
if [ $MAIL_IMAP = YES ]; then
modules="$modules $MAIL_IMAP_MODULE"
MAIL_DEPS="$MAIL_DEPS $MAIL_IMAP_DEPS"
MAIL_SRCS="$MAIL_SRCS $MAIL_IMAP_SRCS"
fi
if [ $MAIL_SMTP = YES ]; then
modules="$modules $MAIL_SMTP_MODULE"
MAIL_DEPS="$MAIL_DEPS $MAIL_SMTP_DEPS"
MAIL_SRCS="$MAIL_SRCS $MAIL_SMTP_SRCS"
fi
modules="$modules $MAIL_AUTH_HTTP_MODULE"
MAIL_SRCS="$MAIL_SRCS $MAIL_AUTH_HTTP_SRCS"
modules="$modules $MAIL_PROXY_MODULE"
MAIL_SRCS="$MAIL_SRCS $MAIL_PROXY_SRCS"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(MAIL_DEPS)"
fi
if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
modules="$modules $NGX_GOOGLE_PERFTOOLS_MODULE"
NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_GOOGLE_PERFTOOLS_SRCS"
fi
if [ $NGX_CPP_TEST = YES ]; then
NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_CPP_TEST_SRCS"
CORE_LIBS="$CORE_LIBS -lstdc++"
fi
if [ $NGX_BACKTRACE = YES ]; then
modules="$modules $NGX_BACKTRACE_MODULE"
NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_BACKTRACE_SRCS"
if ! [ $NGX_DSO = YES ] ; then
LINK="$LINK -rdynamic"
fi
fi
cat << END > $NGX_MODULES_C
#include <ngx_config.h>
#include <ngx_core.h>
$NGX_PRAGMA
END
for mod in $modules
do
echo "extern ngx_module_t $mod;" >> $NGX_MODULES_C
done
echo >> $NGX_MODULES_C
echo 'ngx_module_t *ngx_modules[] = {' >> $NGX_MODULES_C
for mod in $modules
do
echo " &$mod," >> $NGX_MODULES_C
done
if [ $NGX_DSO = YES ] ; then
for i in `seq 1 $NGX_DSO_MAX`
do
echo ' NULL,' >> $NGX_MODULES_C
done
fi
echo ' NULL' >> $NGX_MODULES_C
echo '};' >> $NGX_MODULES_C
echo >> $NGX_MODULES_C
echo 'u_char *ngx_module_names[] = {' >> $NGX_MODULES_C
for mod in $modules
do
echo " (u_char *) \"$mod\"," >> $NGX_MODULES_C
done
if [ $NGX_DSO = YES ] ; then
for i in `seq 1 $NGX_DSO_MAX`
do
echo ' NULL,' >> $NGX_MODULES_C
done
fi
cat << END >> $NGX_MODULES_C
NULL
};
END
if [ $NGX_DSO = YES ] ; then
echo >> $NGX_MODULES_C
echo 'const char *ngx_all_module_names[] = {' >> $NGX_MODULES_C
for mod in $NGX_ALL_MODULES
do
echo " \"$mod\"," >> $NGX_MODULES_C
done
cat << END >> $NGX_MODULES_C
NULL
};
END
echo >> $NGX_MODULES_C
echo 'const char *ngx_dso_abi_all_tags[] = {' >> $NGX_MODULES_C
for tag in $NGX_DSO_ABI_ALL_TAG
do
echo " \"$tag\"," >> $NGX_MODULES_C
done
cat << END >> $NGX_MODULES_C
NULL
};
END
echo '' > $NGX_MODULE_STUBS
for mod in $NGX_ALL_MODULES
do
echo "module_stub $mod;" >> $NGX_MODULE_STUBS
done
fi

View file

@ -0,0 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $have
#define $have 0
#endif
END

1218
Dengine/tengine/auto/options Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,109 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_SOEXT=".so"
echo "checking for $NGX_SYSTEM specific features"
case "$NGX_PLATFORM" in
FreeBSD:*)
. auto/os/freebsd
;;
Linux:*)
. auto/os/linux
;;
SunOS:*)
. auto/os/solaris
;;
Darwin:*)
. auto/os/darwin
;;
win32)
. auto/os/win32
;;
DragonFly:*)
have=NGX_FREEBSD . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
echo " + sendfile() found"
have=NGX_HAVE_SENDFILE . auto/have
CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
ngx_spacer='
'
;;
HP-UX:*)
# HP/UX
have=NGX_HPUX . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
;;
OSF1:*)
# Tru64 UNIX
have=NGX_TRU64 . auto/have_headers
have=NGX_HAVE_STRERROR_R . auto/nohave
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
;;
*)
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
;;
esac
case "$NGX_MACHINE" in
i386 | i686 | i86pc)
have=NGX_HAVE_NONALIGNED . auto/have
NGX_MACH_CACHE_LINE=32
;;
amd64 | x86_64)
have=NGX_HAVE_NONALIGNED . auto/have
NGX_MACH_CACHE_LINE=64
;;
sun4u | sun4v | sparc | sparc64)
have=NGX_ALIGNMENT value=16 . auto/define
# TODO
NGX_MACH_CACHE_LINE=64
;;
ia64 )
have=NGX_ALIGNMENT value=16 . auto/define
# TODO
NGX_MACH_CACHE_LINE=64
;;
*)
have=NGX_ALIGNMENT value=16 . auto/define
NGX_MACH_CACHE_LINE=32
;;
esac
if test -z "$NGX_CPU_CACHE_LINE"; then
NGX_CPU_CACHE_LINE=$NGX_MACH_CACHE_LINE
fi
have=NGX_CPU_CACHE_LINE value=$NGX_CPU_CACHE_LINE . auto/define

View file

@ -0,0 +1,116 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_DARWIN . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $DARWIN_DEPS"
CORE_SRCS="$UNIX_SRCS $DARWIN_SRCS"
ngx_spacer='
'
# kqueue
echo " + kqueue found"
have=NGX_HAVE_KQUEUE . auto/have
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
NGX_KQUEUE_CHECKED=YES
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
if ((kq = kqueue()) == -1) return 1;
kev.ident = 0;
kev.filter = EVFILT_TIMER;
kev.flags = EV_ADD|EV_ENABLE;
kev.fflags = 0;
kev.data = 1000;
kev.udata = 0;
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
if (kev.flags & EV_ERROR) return 1;"
. auto/feature
ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
ngx_feature_name=NGX_DARWIN_KEVENT_BUG
ngx_feature_run=bug
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
struct timeval tv, tv0;
kq = kqueue();
ts.tv_sec = 0;
ts.tv_nsec = 999000000;
gettimeofday(&tv, 0);
kevent(kq, NULL, 0, &kev, 1, &ts);
gettimeofday(&tv0, 0);
timersub(&tv0, &tv, &tv);
if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;"
. auto/feature
# sendfile()
CC_AUX_FLAGS="$CC_AUX_FLAGS"
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
off_t n; off_t off = 0;
n = sendfile(s, fd, off, &n, NULL, 0);
if (n == -1 && errno == ENOSYS) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_SENDFILE . auto/have
CORE_SRCS="$CORE_SRCS $DARWIN_SENDFILE_SRCS"
fi
ngx_feature="atomic(3)"
ngx_feature_name=NGX_DARWIN_ATOMIC
ngx_feature_run=no
ngx_feature_incs="#include <libkern/OSAtomic.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int32_t lock, n;
n = OSAtomicCompareAndSwap32Barrier(0, 1, &lock)"
. auto/feature

View file

@ -0,0 +1,144 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_FREEBSD . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
ngx_spacer='
'
# __FreeBSD_version and sysctl kern.osreldate are the best ways
# to determine whether some capability exists and is safe to use.
# __FreeBSD_version is used for the testing of the build environment.
# sysctl kern.osreldate is used for the testing of the kernel capabilities.
version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
| sed -e 's/^.* \(.*\)$/\1/'`
osreldate=`/sbin/sysctl -n kern.osreldate`
# setproctitle() in libutil
if [ \( $version -ge 500000 -a $version -lt 500012 \) \
-o $version -lt 410002 ]
then
echo " + setproctitle() in libutil"
CORE_LIBS="$CORE_LIBS -lutil"
NGX_SETPROCTITLE_LIB="-lutil"
fi
# sendfile
if [ $osreldate -gt 300007 ]; then
echo " + sendfile() found"
have=NGX_HAVE_SENDFILE . auto/have
CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
fi
if [ $osreldate -gt 502103 ]; then
echo " + sendfile()'s SF_NODISKIO found"
have=NGX_HAVE_AIO_SENDFILE . auto/have
fi
# POSIX semaphores
# http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
if [ $osreldate -ge 701106 ]; then
echo " + POSIX semaphores should work"
else
have=NGX_HAVE_POSIX_SEM . auto/nohave
fi
# kqueue
if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \
-o $osreldate -ge 500011 ]
then
echo " + kqueue found"
have=NGX_HAVE_KQUEUE . auto/have
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
fi
NGX_KQUEUE_CHECKED=YES
# kqueue's NOTE_LAWAT
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500018 ]
then
echo " + kqueue's NOTE_LOWAT found"
have=NGX_HAVE_LOWAT_EVENT . auto/have
fi
# kqueue's EVFILT_TIMER
if [ \( $version -lt 500000 -a $version -ge 440001 \) \
-o $version -ge 500023 ]
then
echo " + kqueue's EVFILT_TIMER found"
have=NGX_HAVE_TIMER_EVENT . auto/have
fi
if [ $USE_THREADS = "rfork" ]; then
echo " + using rfork()"
# # kqueue's EVFILT_SIGNAL is safe
#
# if [ $version -gt 460101 ]; then
# echo " + kqueue's EVFILT_SIGNAL is safe"
# have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
# else
# echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
# echo "FreeBSD version, so --with-threads=rfork could not be used"
# echo
#
# exit 1
# fi
fi
if [ $EVENT_AIO = YES ]; then
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500014 ]
then
have=NGX_HAVE_AIO . auto/have
EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
CORE_SRCS="$CORE_SRCS $AIO_SRCS"
else
cat << END
$0: error: the kqueue does not support AIO on this FreeBSD version
END
exit 1
fi
fi
# cpuset_setaffinity()
if [ $version -ge 701000 ]; then
echo " + cpuset_setaffinity() found"
have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
fi

View file

@ -0,0 +1,199 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_LINUX . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $LINUX_DEPS"
CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
ngx_spacer='
'
cc_aux_flags="$CC_AUX_FLAGS"
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
# Linux kernel version
version=$((`uname -r \
| sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
\1*256*256+\2*256+\3/p' \
-e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
version=${version:-0}
# enable the rt signals on Linux between 2.2.19 and 2.6.17
if [ \( $version -ge 131603 -a $version -lt 132626 \) -o $EVENT_RTSIG = YES ]
then
echo " + rt signals found"
have=NGX_HAVE_RTSIG . auto/have
EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
EVENT_FOUND=YES
fi
# posix_fadvise64() had been implemented in 2.5.60
if [ $version -lt 132412 ]; then
have=NGX_HAVE_POSIX_FADVISE . auto/nohave
fi
# epoll, EPOLLET version
ngx_feature="epoll"
ngx_feature_name="NGX_HAVE_EPOLL"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
ee.data.ptr = NULL;
efd = epoll_create(100);
if (efd == -1) return 1;"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_CLEAR_EVENT . auto/have
CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
EVENT_FOUND=YES
# EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8
ngx_feature="EPOLLRDHUP"
ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
ngx_feature_run=no
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0, fd = 0;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
ee.data.ptr = NULL;
epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
. auto/feature
fi
# O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14
ngx_feature="O_PATH"
ngx_feature_name="NGX_HAVE_O_PATH"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int fd; struct stat sb;
fd = openat(AT_FDCWD, \".\", O_PATH|O_DIRECTORY|O_NOFOLLOW);
if (fstatat(fd, \"\", &sb, AT_EMPTY_PATH) != 0) return 1"
. auto/feature
# sendfile()
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
ssize_t n; off_t off = 0;
n = sendfile(s, fd, &off, 1);
if (n == -1 && errno == ENOSYS) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $LINUX_SENDFILE_SRCS"
fi
# sendfile64()
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
ngx_feature="sendfile64()"
ngx_feature_name="NGX_HAVE_SENDFILE64"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
ssize_t n; off_t off = 0;
n = sendfile(s, fd, &off, 1);
if (n == -1 && errno == ENOSYS) return 1"
. auto/feature
ngx_include="sys/prctl.h"; . auto/include
# prctl(PR_SET_DUMPABLE)
ngx_feature="prctl(PR_SET_DUMPABLE)"
ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/prctl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) return 1"
. auto/feature
# sched_setaffinity()
ngx_feature="sched_setaffinity()"
ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="cpu_set_t mask;
CPU_ZERO(&mask);
CPU_SET(0, &mask);
sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
. auto/feature
# crypt_r()
ngx_feature="crypt_r()"
ngx_feature_name="NGX_HAVE_GNU_CRYPT_R"
ngx_feature_run=no
ngx_feature_incs="#include <crypt.h>"
ngx_feature_path=
ngx_feature_libs=-lcrypt
ngx_feature_test="struct crypt_data cd;
crypt_r(\"key\", \"salt\", &cd);"
. auto/feature
# reuseport
ngx_feature="SO_REUSEPORT"
ngx_feature_name="NGX_HAVE_REUSEPORT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_REUSEPORT, NULL, 0)"
. auto/feature
ngx_include="sys/vfs.h"; . auto/include
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"

View file

@ -0,0 +1,61 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_SOLARIS . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
CORE_LIBS="$CORE_LIBS -lsocket -lnsl"
NGX_RPATH=YES
# Solaris's make does not support a blank line between target and rules
ngx_spacer=
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_FILE_OFFSET_BITS=64 -lsocket -lnsl"
if [ $ZLIB_ASM != NO ]; then
echo "$0: error: the --with-zlib-asm=CPU option is not supported"
echo "on that platform"
echo
exit 1
fi
ngx_feature="sendfilev()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/sendfile.h>"
ngx_feature_path=
ngx_feature_libs="-lsendfile"
ngx_feature_test="int fd = 1; sendfilevec_t vec[1];
size_t sent; ssize_t n;
n = sendfilev(fd, vec, 1, &sent);
if (n == -1) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
CORE_LIBS="$CORE_LIBS -lsendfile"
fi
ngx_feature="event ports"
ngx_feature_name="NGX_HAVE_EVENTPORT"
ngx_feature_run=no
ngx_feature_incs="#include <port.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n = port_create()"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
fi

View file

@ -0,0 +1,40 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_WIN32 . auto/have_headers
CORE_INCS="$WIN32_INCS"
CORE_DEPS="$WIN32_DEPS"
CORE_SRCS="$WIN32_SRCS $IOCP_SRCS"
OS_CONFIG="$WIN32_CONFIG"
NGX_ICONS="$NGX_WIN32_ICONS"
SELECT_SRCS=$WIN32_SELECT_SRCS
case "$NGX_CC_NAME" in
gcc)
CORE_LIBS="$CORE_LIBS -ladvapi32 -lws2_32"
;;
*)
CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
;;
esac
EVENT_MODULES="$EVENT_MODULES $IOCP_MODULE"
EVENT_FOUND=YES
if [ $EVENT_SELECT = NO ]; then
CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
fi
if [ $NGX_IPV6 = YES ]; then
have=NGX_HAVE_INET6 . auto/have
fi
have=NGX_HAVE_AIO . auto/have
have=NGX_HAVE_IOCP . auto/have

View file

@ -0,0 +1,780 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module"
CORE_INCS="src/core"
CORE_DEPS="src/core/nginx.h \
src/core/ngx_config.h \
src/core/ngx_core.h \
src/core/ngx_log.h \
src/core/ngx_palloc.h \
src/core/ngx_array.h \
src/core/ngx_list.h \
src/core/ngx_hash.h \
src/core/ngx_buf.h \
src/core/ngx_queue.h \
src/core/ngx_string.h \
src/core/ngx_parse.h \
src/core/ngx_inet.h \
src/core/ngx_file.h \
src/core/ngx_crc.h \
src/core/ngx_crc32.h \
src/core/ngx_murmurhash.h \
src/core/ngx_md5.h \
src/core/ngx_sha1.h \
src/core/ngx_rbtree.h \
src/core/ngx_trie.h \
src/core/ngx_segment_tree.h \
src/core/ngx_radix_tree.h \
src/core/ngx_slab.h \
src/core/ngx_times.h \
src/core/ngx_shmtx.h \
src/core/ngx_connection.h \
src/core/ngx_cycle.h \
src/core/ngx_conf_file.h \
src/core/ngx_resolver.h \
src/core/ngx_open_file_cache.h \
src/core/ngx_crypt.h \
src/core/ngx_proxy_protocol.h"
CORE_SRCS="src/core/nginx.c \
src/core/ngx_log.c \
src/core/ngx_palloc.c \
src/core/ngx_array.c \
src/core/ngx_list.c \
src/core/ngx_hash.c \
src/core/ngx_buf.c \
src/core/ngx_queue.c \
src/core/ngx_output_chain.c \
src/core/ngx_string.c \
src/core/ngx_parse.c \
src/core/ngx_inet.c \
src/core/ngx_file.c \
src/core/ngx_crc32.c \
src/core/ngx_murmurhash.c \
src/core/ngx_md5.c \
src/core/ngx_rbtree.c \
src/core/ngx_trie.c
src/core/ngx_segment_tree.c \
src/core/ngx_radix_tree.c \
src/core/ngx_slab.c \
src/core/ngx_times.c \
src/core/ngx_shmtx.c \
src/core/ngx_connection.c \
src/core/ngx_cycle.c \
src/core/ngx_spinlock.c \
src/core/ngx_cpuinfo.c \
src/core/ngx_conf_file.c \
src/core/ngx_resolver.c \
src/core/ngx_open_file_cache.c \
src/core/ngx_crypt.c \
src/core/ngx_proxy_protocol.c"
REGEX_MODULE=ngx_regex_module
REGEX_DEPS=src/core/ngx_regex.h
REGEX_SRCS=src/core/ngx_regex.c
DSO_MODULE=ngx_dso_module
DSO_SRCS="src/core/ngx_dso_module.c"
DSO_LIBS=
DSO_INCS=
OPENSSL_MODULE=ngx_openssl_module
OPENSSL_DEPS=src/event/ngx_event_openssl.h
OPENSSL_SRCS="src/event/ngx_event_openssl.c \
src/event/ngx_event_openssl_stapling.c"
EVENT_MODULES="ngx_events_module ngx_event_core_module"
EVENT_INCS="src/event src/event/modules"
EVENT_DEPS="src/event/ngx_event.h \
src/event/ngx_event_timer.h \
src/event/ngx_event_posted.h \
src/event/ngx_event_busy_lock.h \
src/event/ngx_event_connect.h \
src/event/ngx_event_pipe.h"
EVENT_SRCS="src/event/ngx_event.c \
src/event/ngx_event_timer.c \
src/event/ngx_event_posted.c \
src/event/ngx_event_busy_lock.c \
src/event/ngx_event_accept.c \
src/event/ngx_event_connect.c \
src/event/ngx_event_pipe.c"
SELECT_MODULE=ngx_select_module
SELECT_SRCS=src/event/modules/ngx_select_module.c
WIN32_SELECT_SRCS=src/event/modules/ngx_win32_select_module.c
POLL_MODULE=ngx_poll_module
POLL_SRCS=src/event/modules/ngx_poll_module.c
KQUEUE_MODULE=ngx_kqueue_module
KQUEUE_SRCS=src/event/modules/ngx_kqueue_module.c
DEVPOLL_MODULE=ngx_devpoll_module
DEVPOLL_SRCS=src/event/modules/ngx_devpoll_module.c
EVENTPORT_MODULE=ngx_eventport_module
EVENTPORT_SRCS=src/event/modules/ngx_eventport_module.c
EPOLL_MODULE=ngx_epoll_module
EPOLL_SRCS=src/event/modules/ngx_epoll_module.c
RTSIG_MODULE=ngx_rtsig_module
RTSIG_SRCS=src/event/modules/ngx_rtsig_module.c
IOCP_MODULE=ngx_iocp_module
IOCP_SRCS=src/event/modules/ngx_iocp_module.c
PROCS_MODULES="ngx_procs_module ngx_proc_core_module"
PROCS_DEPS="src/proc/ngx_proc.h"
PROCS_INCS="src/proc"
PROCS_SRCS="src/proc/ngx_proc.c"
AIO_MODULE=ngx_aio_module
AIO_SRCS="src/event/modules/ngx_aio_module.c \
src/os/unix/ngx_aio_read.c \
src/os/unix/ngx_aio_write.c \
src/os/unix/ngx_aio_read_chain.c \
src/os/unix/ngx_aio_write_chain.c"
FILE_AIO_SRCS="src/os/unix/ngx_file_aio_read.c"
LINUX_AIO_SRCS="src/os/unix/ngx_linux_aio_read.c"
SYSLOG_DEPS="src/os/unix/ngx_syslog.h"
SYSLOG_SRCS="src/os/unix/ngx_syslog.c"
PIPE_DEPS="src/os/unix/ngx_pipe.h"
PIPE_SRCS="src/os/unix/ngx_pipe.c"
UNIX_INCS="$CORE_INCS $EVENT_INCS src/os/unix"
UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/unix/ngx_time.h \
src/os/unix/ngx_errno.h \
src/os/unix/ngx_alloc.h \
src/os/unix/ngx_files.h \
src/os/unix/ngx_channel.h \
src/os/unix/ngx_shmem.h \
src/os/unix/ngx_process.h \
src/os/unix/ngx_setaffinity.h \
src/os/unix/ngx_setproctitle.h \
src/os/unix/ngx_atomic.h \
src/os/unix/ngx_gcc_atomic_x86.h \
src/os/unix/ngx_thread.h \
src/os/unix/ngx_socket.h \
src/os/unix/ngx_os.h \
src/os/unix/ngx_user.h \
src/os/unix/ngx_pipe.h \
src/os/unix/ngx_sysinfo.h \
src/os/unix/ngx_process_cycle.h"
# add to UNIX_DEPS
# src/os/unix/ngx_gcc_atomic_amd64.h \
# src/os/unix/ngx_gcc_atomic_sparc64.h \
# src/os/unix/ngx_gcc_atomic_ppc.h \
# src/os/unix/ngx_sunpro_atomic_sparc64.h \
# src/os/unix/ngx_sunpro_x86.il \
# src/os/unix/ngx_sunpro_amd64.il \
# src/os/unix/ngx_sunpro_sparc64.il \
UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
src/os/unix/ngx_time.c \
src/os/unix/ngx_errno.c \
src/os/unix/ngx_alloc.c \
src/os/unix/ngx_files.c \
src/os/unix/ngx_socket.c \
src/os/unix/ngx_recv.c \
src/os/unix/ngx_readv_chain.c \
src/os/unix/ngx_udp_recv.c \
src/os/unix/ngx_send.c \
src/os/unix/ngx_writev_chain.c \
src/os/unix/ngx_channel.c \
src/os/unix/ngx_shmem.c \
src/os/unix/ngx_process.c \
src/os/unix/ngx_daemon.c \
src/os/unix/ngx_setproctitle.c \
src/os/unix/ngx_posix_init.c \
src/os/unix/ngx_user.c \
src/os/unix/ngx_pipe.c \
src/os/unix/ngx_sysinfo.c \
src/os/unix/ngx_process_cycle.c"
POSIX_DEPS=src/os/unix/ngx_posix_config.h
FREEBSD_DEPS="src/os/unix/ngx_freebsd_config.h src/os/unix/ngx_freebsd.h"
FREEBSD_SRCS=src/os/unix/ngx_freebsd_init.c
FREEBSD_SENDFILE_SRCS=src/os/unix/ngx_freebsd_sendfile_chain.c
FREEBSD_RFORK_DEPS="src/os/unix/ngx_freebsd_rfork_thread.h"
FREEBSD_RFORK_SRCS="src/os/unix/ngx_freebsd_rfork_thread.c"
FREEBSD_RFORK_THREAD_SRCS="src/os/unix/rfork_thread.S"
PTHREAD_SRCS="src/os/unix/ngx_pthread_thread.c"
LINUX_DEPS="src/os/unix/ngx_linux_config.h src/os/unix/ngx_linux.h"
LINUX_SRCS=src/os/unix/ngx_linux_init.c
LINUX_SENDFILE_SRCS=src/os/unix/ngx_linux_sendfile_chain.c
SOLARIS_DEPS="src/os/unix/ngx_solaris_config.h src/os/unix/ngx_solaris.h"
SOLARIS_SRCS=src/os/unix/ngx_solaris_init.c
SOLARIS_SENDFILEV_SRCS=src/os/unix/ngx_solaris_sendfilev_chain.c
DARWIN_DEPS="src/os/unix/ngx_darwin_config.h src/os/unix/ngx_darwin.h"
DARWIN_SRCS=src/os/unix/ngx_darwin_init.c
DARWIN_SENDFILE_SRCS=src/os/unix/ngx_darwin_sendfile_chain.c
WIN32_INCS="$CORE_INCS $EVENT_INCS src/os/win32"
WIN32_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/win32/ngx_win32_config.h \
src/os/win32/ngx_time.h \
src/os/win32/ngx_errno.h \
src/os/win32/ngx_alloc.h \
src/os/win32/ngx_files.h \
src/os/win32/ngx_shmem.h \
src/os/win32/ngx_process.h \
src/os/win32/ngx_atomic.h \
src/os/win32/ngx_thread.h \
src/os/win32/ngx_socket.h \
src/os/win32/ngx_os.h \
src/os/win32/ngx_user.h \
src/os/win32/ngx_process_cycle.h"
WIN32_CONFIG=src/os/win32/ngx_win32_config.h
WIN32_SRCS="$CORE_SRCS $EVENT_SRCS \
src/os/win32/ngx_errno.c \
src/os/win32/ngx_alloc.c \
src/os/win32/ngx_files.c \
src/os/win32/ngx_shmem.c \
src/os/win32/ngx_time.c \
src/os/win32/ngx_process.c \
src/os/win32/ngx_thread.c \
src/os/win32/ngx_socket.c \
src/os/win32/ngx_wsarecv.c \
src/os/win32/ngx_wsarecv_chain.c \
src/os/win32/ngx_udp_wsarecv.c \
src/os/win32/ngx_wsasend.c \
src/os/win32/ngx_wsasend_chain.c \
src/os/win32/ngx_win32_init.c \
src/os/win32/ngx_user.c \
src/os/win32/ngx_event_log.c \
src/os/win32/ngx_process_cycle.c \
src/event/ngx_event_acceptex.c"
NGX_WIN32_ICONS="src/os/win32/nginx.ico"
NGX_WIN32_RC="src/os/win32/nginx.rc"
# the http modules that have their logging formats
# must be after ngx_http_log_module
HTTP_MODULES="ngx_http_module \
ngx_http_core_module \
ngx_http_log_module \
ngx_http_upstream_module"
HTTP_WRITE_FILTER_MODULE="ngx_http_write_filter_module"
HTTP_HEADER_FILTER_MODULE="ngx_http_header_filter_module"
HTTP_POSTPONE_FILTER_MODULE=ngx_http_postpone_filter_module
HTTP_COPY_FILTER_MODULE=ngx_http_copy_filter_module
HTTP_CHUNKED_FILTER_MODULE=ngx_http_chunked_filter_module
HTTP_HEADERS_FILTER_MODULE=ngx_http_headers_filter_module
HTTP_RANGE_HEADER_FILTER_MODULE=ngx_http_range_header_filter_module
HTTP_RANGE_BODY_FILTER_MODULE=ngx_http_range_body_filter_module
HTTP_NOT_MODIFIED_FILTER_MODULE=ngx_http_not_modified_filter_module
HTTP_STATIC_MODULE=ngx_http_static_module
HTTP_INDEX_MODULE=ngx_http_index_module
HTTP_INCS="src/http src/http/modules"
HTTP_DEPS="src/http/ngx_http.h \
src/http/ngx_http_request.h \
src/http/ngx_http_config.h \
src/http/ngx_http_core_module.h \
src/http/ngx_http_cache.h \
src/http/ngx_http_variables.h \
src/http/ngx_http_script.h \
src/http/ngx_http_upstream.h \
src/http/ngx_http_upstream_round_robin.h \
src/http/ngx_http_busy_lock.h"
HTTP_SRCS="src/http/ngx_http.c \
src/http/ngx_http_core_module.c \
src/http/ngx_http_special_response.c \
src/http/ngx_http_request.c \
src/http/ngx_http_parse.c \
src/http/ngx_http_header_filter_module.c \
src/http/ngx_http_write_filter_module.c \
src/http/ngx_http_copy_filter_module.c \
src/http/modules/ngx_http_log_module.c \
src/http/ngx_http_request_body.c \
src/http/ngx_http_variables.c \
src/http/ngx_http_script.c \
src/http/ngx_http_upstream.c \
src/http/ngx_http_upstream_round_robin.c \
src/http/ngx_http_parse_time.c \
src/http/modules/ngx_http_static_module.c \
src/http/modules/ngx_http_index_module.c \
src/http/modules/ngx_http_chunked_filter_module.c \
src/http/modules/ngx_http_range_filter_module.c \
src/http/modules/ngx_http_headers_filter_module.c \
src/http/modules/ngx_http_not_modified_filter_module.c"
# STUB
HTTP_SRCS="$HTTP_SRCS src/http/ngx_http_busy_lock.c"
HTTP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c
HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c
HTTP_SPDY_MODULE=ngx_http_spdy_module
HTTP_SPDY_FILTER_MODULE=ngx_http_spdy_filter_module
HTTP_SPDY_DEPS="src/http/ngx_http_spdy.h \
src/http/ngx_http_spdy_module.h"
HTTP_SPDY_SRCS="src/http/ngx_http_spdy.c \
src/http/ngx_http_spdy_module.c \
src/http/ngx_http_spdy_filter_module.c"
HTTP_CHARSET_FILTER_MODULE=ngx_http_charset_filter_module
HTTP_CHARSET_SRCS=src/http/modules/ngx_http_charset_filter_module.c
HTTP_GZIP_FILTER_MODULE=ngx_http_gzip_filter_module
HTTP_GZIP_SRCS=src/http/modules/ngx_http_gzip_filter_module.c
HTTP_GUNZIP_FILTER_MODULE=ngx_http_gunzip_filter_module
HTTP_GUNZIP_SRCS=src/http/modules/ngx_http_gunzip_filter_module.c
HTTP_SSI_FILTER_MODULE=ngx_http_ssi_filter_module
HTTP_SSI_DEPS=src/http/modules/ngx_http_ssi_filter_module.h
HTTP_SSI_SRCS=src/http/modules/ngx_http_ssi_filter_module.c
HTTP_XSLT_FILTER_MODULE=ngx_http_xslt_filter_module
HTTP_XSLT_SRCS=src/http/modules/ngx_http_xslt_filter_module.c
HTTP_IMAGE_FILTER_MODULE=ngx_http_image_filter_module
HTTP_IMAGE_SRCS=src/http/modules/ngx_http_image_filter_module.c
HTTP_SUB_FILTER_MODULE=ngx_http_sub_filter_module
HTTP_SUB_SRCS=src/http/modules/ngx_http_sub_filter_module.c
HTTP_USERID_FILTER_MODULE=ngx_http_userid_filter_module
HTTP_USERID_SRCS=src/http/modules/ngx_http_userid_filter_module.c
HTTP_REALIP_MODULE=ngx_http_realip_module
HTTP_REALIP_SRCS=src/http/modules/ngx_http_realip_module.c
HTTP_ADDITION_FILTER_MODULE=ngx_http_addition_filter_module
HTTP_ADDITION_SRCS=src/http/modules/ngx_http_addition_filter_module.c
HTTP_FOOTER_FILTER_MODULE=ngx_http_footer_filter_module
HTTP_FOOTER_FILTER_SRCS=src/http/modules/ngx_http_footer_filter_module.c
HTTP_TRIM_FILTER_MODULE=ngx_http_trim_filter_module
HTTP_TRIM_FILTER_SRCS=src/http/modules/ngx_http_trim_filter_module.c
HTTP_DAV_MODULE=ngx_http_dav_module
HTTP_DAV_SRCS=src/http/modules/ngx_http_dav_module.c
HTTP_ACCESS_MODULE=ngx_http_access_module
HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_module.c
HTTP_AUTH_BASIC_MODULE=ngx_http_auth_basic_module
HTTP_AUTH_BASIC_SRCS=src/http/modules/ngx_http_auth_basic_module.c
HTTP_CONCAT_MODULE=ngx_http_concat_module
HTTP_CONCAT_SRCS=src/http/modules/ngx_http_concat_module.c
HTTP_AUTH_REQUEST_MODULE=ngx_http_auth_request_module
HTTP_AUTH_REQUEST_SRCS=src/http/modules/ngx_http_auth_request_module.c
HTTP_AUTOINDEX_MODULE=ngx_http_autoindex_module
HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_module.c
HTTP_RANDOM_INDEX_MODULE=ngx_http_random_index_module
HTTP_RANDOM_INDEX_SRCS=src/http/modules/ngx_http_random_index_module.c
HTTP_STATUS_MODULE=ngx_http_status_module
HTTP_STATUS_SRCS=src/http/modules/ngx_http_status_module.c
HTTP_GEO_MODULE=ngx_http_geo_module
HTTP_GEO_SRCS=src/http/modules/ngx_http_geo_module.c
HTTP_GEOIP_MODULE=ngx_http_geoip_module
HTTP_GEOIP_SRCS=src/http/modules/ngx_http_geoip_module.c
HTTP_MAP_MODULE=ngx_http_map_module
HTTP_MAP_SRCS=src/http/modules/ngx_http_map_module.c
HTTP_SPLIT_CLIENTS_MODULE=ngx_http_split_clients_module
HTTP_SPLIT_CLIENTS_SRCS=src/http/modules/ngx_http_split_clients_module.c
HTTP_REFERER_MODULE=ngx_http_referer_module
HTTP_REFERER_SRCS=src/http/modules/ngx_http_referer_module.c
HTTP_REWRITE_MODULE=ngx_http_rewrite_module
HTTP_REWRITE_SRCS=src/http/modules/ngx_http_rewrite_module.c
HTTP_SSL_MODULE=ngx_http_ssl_module
HTTP_SSL_DEPS=src/http/modules/ngx_http_ssl_module.h
HTTP_SSL_SRCS=src/http/modules/ngx_http_ssl_module.c
HTTP_PROXY_MODULE=ngx_http_proxy_module
HTTP_PROXY_SRCS=src/http/modules/ngx_http_proxy_module.c
HTTP_FASTCGI_MODULE=ngx_http_fastcgi_module
HTTP_FASTCGI_SRCS=src/http/modules/ngx_http_fastcgi_module.c
HTTP_UWSGI_MODULE=ngx_http_uwsgi_module
HTTP_UWSGI_SRCS=src/http/modules/ngx_http_uwsgi_module.c
HTTP_SCGI_MODULE=ngx_http_scgi_module
HTTP_SCGI_SRCS=src/http/modules/ngx_http_scgi_module.c
HTTP_PERL_MODULE=ngx_http_perl_module
HTTP_PERL_INCS=src/http/modules/perl
HTTP_PERL_DEPS=src/http/modules/perl/ngx_http_perl_module.h
HTTP_PERL_SRCS=src/http/modules/perl/ngx_http_perl_module.c
HTTP_MEMCACHED_MODULE=ngx_http_memcached_module
HTTP_MEMCACHED_SRCS=src/http/modules/ngx_http_memcached_module.c
HTTP_LIMIT_CONN_MODULE=ngx_http_limit_conn_module
HTTP_LIMIT_CONN_SRCS=src/http/modules/ngx_http_limit_conn_module.c
HTTP_LIMIT_REQ_MODULE=ngx_http_limit_req_module
HTTP_LIMIT_REQ_SRCS=src/http/modules/ngx_http_limit_req_module.c
HTTP_EMPTY_GIF_MODULE=ngx_http_empty_gif_module
HTTP_EMPTY_GIF_SRCS=src/http/modules/ngx_http_empty_gif_module.c
HTTP_BROWSER_MODULE=ngx_http_browser_module
HTTP_BROWSER_SRCS=src/http/modules/ngx_http_browser_module.c
HTTP_USER_AGENT_MODULE=ngx_http_user_agent_module
HTTP_USER_AGENT_SRCS=src/http/modules/ngx_http_user_agent_module.c
HTTP_SECURE_LINK_MODULE=ngx_http_secure_link_module
HTTP_SECURE_LINK_SRCS=src/http/modules/ngx_http_secure_link_module.c
HTTP_DEGRADATION_MODULE=ngx_http_degradation_module
HTTP_DEGRADATION_SRCS=src/http/modules/ngx_http_degradation_module.c
HTTP_SYSGUARD_MODULE=ngx_http_sysguard_module
HTTP_SYSGUARD_SRCS=src/http/modules/ngx_http_sysguard_module.c
HTTP_FLV_MODULE=ngx_http_flv_module
HTTP_FLV_SRCS=src/http/modules/ngx_http_flv_module.c
HTTP_SLICE_MODULE=ngx_http_slice_module
HTTP_SLICE_SRCS=src/http/modules/ngx_http_slice_module.c
HTTP_MP4_MODULE=ngx_http_mp4_module
HTTP_MP4_SRCS=src/http/modules/ngx_http_mp4_module.c
HTTP_GZIP_STATIC_MODULE=ngx_http_gzip_static_module
HTTP_GZIP_STATIC_SRCS=src/http/modules/ngx_http_gzip_static_module.c
HTTP_UPSTREAM_IP_HASH_MODULE=ngx_http_upstream_ip_hash_module
HTTP_UPSTREAM_IP_HASH_SRCS=src/http/modules/ngx_http_upstream_ip_hash_module.c
HTTP_UPSTREAM_CHECK_MODULE=ngx_http_upstream_check_module
HTTP_UPSTREAM_CHECK_SRCS=src/http/ngx_http_upstream_check_module.c
HTTP_UPSTREAM_CONSISTENT_HASH_MODULE=ngx_http_upstream_consistent_hash_module
HTTP_UPSTREAM_CONSISTENT_HASH_SRCS=src/http/modules/ngx_http_upstream_consistent_hash_module.c
HTTP_UPSTREAM_LEAST_CONN_MODULE=ngx_http_upstream_least_conn_module
HTTP_UPSTREAM_LEAST_CONN_SRCS=" \
src/http/modules/ngx_http_upstream_least_conn_module.c"
HTTP_UPSTREAM_SESSION_STICKY_MODULE=ngx_http_upstream_session_sticky_module
HTTP_UPSTREAM_SESSION_STICKY_SRCS=src/http/modules/ngx_http_upstream_session_sticky_module.c
HTTP_UPSTREAM_KEEPALIVE_MODULE=ngx_http_upstream_keepalive_module
HTTP_UPSTREAM_KEEPALIVE_SRCS=" \
src/http/modules/ngx_http_upstream_keepalive_module.c"
HTTP_UPSTREAM_DYNAMIC_MODULE=ngx_http_upstream_dynamic_module
HTTP_UPSTREAM_DYNAMIC_SRCS=" \
src/http/modules/ngx_http_upstream_dynamic_module.c"
HTTP_DYUPS_MODULE=ngx_http_dyups_module
HTTP_DYUPS_SRCS="src/http/modules/ngx_http_dyups_module.c"
HTTP_DYUPS_DEPS="src/http/modules/ngx_http_dyups.h"
HTTP_DYUPS_LUA_SRCS="src/http/modules/ngx_http_dyups_lua.c"
HTTP_DYUPS_LUA_DEPS="src/http/modules/ngx_http_dyups_lua.h"
HTTP_REQ_STATUS_MODULE=ngx_http_reqstat_module
HTTP_REQ_STATUS_SRCS=src/http/modules/ngx_http_reqstat_module.c
HTTP_REQ_STATUS_DEPS=src/http/modules/ngx_http_reqstat.h
MAIL_INCS="src/mail"
MAIL_DEPS="src/mail/ngx_mail.h"
MAIL_MODULES="ngx_mail_module ngx_mail_core_module"
MAIL_SRCS="src/mail/ngx_mail.c \
src/mail/ngx_mail_core_module.c \
src/mail/ngx_mail_handler.c \
src/mail/ngx_mail_parse.c"
MAIL_POP3_MODULE="ngx_mail_pop3_module"
MAIL_POP3_DEPS="src/mail/ngx_mail_pop3_module.h"
MAIL_POP3_SRCS="src/mail/ngx_mail_pop3_module.c \
src/mail/ngx_mail_pop3_handler.c"
MAIL_IMAP_MODULE="ngx_mail_imap_module"
MAIL_IMAP_DEPS="src/mail/ngx_mail_imap_module.h"
MAIL_IMAP_SRCS="src/mail/ngx_mail_imap_module.c \
src/mail/ngx_mail_imap_handler.c"
MAIL_SMTP_MODULE="ngx_mail_smtp_module"
MAIL_SMTP_DEPS="src/mail/ngx_mail_smtp_module.h"
MAIL_SMTP_SRCS="src/mail/ngx_mail_smtp_module.c \
src/mail/ngx_mail_smtp_handler.c"
MAIL_SSL_MODULE="ngx_mail_ssl_module"
MAIL_SSL_DEPS="src/mail/ngx_mail_ssl_module.h"
MAIL_SSL_SRCS="src/mail/ngx_mail_ssl_module.c"
MAIL_AUTH_HTTP_MODULE="ngx_mail_auth_http_module"
MAIL_AUTH_HTTP_SRCS="src/mail/ngx_mail_auth_http_module.c"
MAIL_PROXY_MODULE="ngx_mail_proxy_module"
MAIL_PROXY_SRCS="src/mail/ngx_mail_proxy_module.c"
NGX_GOOGLE_PERFTOOLS_MODULE=ngx_google_perftools_module
NGX_GOOGLE_PERFTOOLS_SRCS=src/misc/ngx_google_perftools_module.c
NGX_CPP_TEST_SRCS=src/misc/ngx_cpp_test_module.cpp
NGX_BACKTRACE_MODULE=ngx_backtrace_module
NGX_BACKTRACE_SRCS=src/misc/ngx_backtrace_module.c
NGX_HTTP_LUA_MODULE=ngx_http_lua_module
NGX_HTTP_LUA_MODULE_SRCS="modules/ngx_http_lua_module/src/ngx_http_lua_script.c \
modules/ngx_http_lua_module/src/ngx_http_lua_log.c \
modules/ngx_http_lua_module/src/ngx_http_lua_subrequest.c \
modules/ngx_http_lua_module/src/ngx_http_lua_ndk.c \
modules/ngx_http_lua_module/src/ngx_http_lua_control.c \
modules/ngx_http_lua_module/src/ngx_http_lua_time.c \
modules/ngx_http_lua_module/src/ngx_http_lua_misc.c \
modules/ngx_http_lua_module/src/ngx_http_lua_variable.c \
modules/ngx_http_lua_module/src/ngx_http_lua_string.c \
modules/ngx_http_lua_module/src/ngx_http_lua_output.c \
modules/ngx_http_lua_module/src/ngx_http_lua_headers.c \
modules/ngx_http_lua_module/src/ngx_http_lua_req_body.c \
modules/ngx_http_lua_module/src/ngx_http_lua_uri.c \
modules/ngx_http_lua_module/src/ngx_http_lua_args.c \
modules/ngx_http_lua_module/src/ngx_http_lua_ctx.c \
modules/ngx_http_lua_module/src/ngx_http_lua_regex.c \
modules/ngx_http_lua_module/src/ngx_http_lua_module.c \
modules/ngx_http_lua_module/src/ngx_http_lua_headers_out.c \
modules/ngx_http_lua_module/src/ngx_http_lua_headers_in.c \
modules/ngx_http_lua_module/src/ngx_http_lua_directive.c \
modules/ngx_http_lua_module/src/ngx_http_lua_consts.c \
modules/ngx_http_lua_module/src/ngx_http_lua_exception.c \
modules/ngx_http_lua_module/src/ngx_http_lua_util.c \
modules/ngx_http_lua_module/src/ngx_http_lua_cache.c \
modules/ngx_http_lua_module/src/ngx_http_lua_contentby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_rewriteby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_accessby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_setby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_capturefilter.c \
modules/ngx_http_lua_module/src/ngx_http_lua_clfactory.c \
modules/ngx_http_lua_module/src/ngx_http_lua_pcrefix.c \
modules/ngx_http_lua_module/src/ngx_http_lua_headerfilterby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_shdict.c \
modules/ngx_http_lua_module/src/ngx_http_lua_socket_tcp.c \
modules/ngx_http_lua_module/src/ngx_http_lua_api.c \
modules/ngx_http_lua_module/src/ngx_http_lua_logby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_sleep.c \
modules/ngx_http_lua_module/src/ngx_http_lua_coroutine.c \
modules/ngx_http_lua_module/src/ngx_http_lua_bodyfilterby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_initby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_initworkerby.c \
modules/ngx_http_lua_module/src/ngx_http_lua_socket_udp.c \
modules/ngx_http_lua_module/src/ngx_http_lua_req_method.c \
modules/ngx_http_lua_module/src/ngx_http_lua_phase.c \
modules/ngx_http_lua_module/src/ngx_http_lua_uthread.c \
modules/ngx_http_lua_module/src/ngx_http_lua_timer.c \
modules/ngx_http_lua_module/src/ngx_http_lua_config.c \
modules/ngx_http_lua_module/src/ngx_http_lua_worker.c"
NGX_HTTP_LUA_MODULE_DEPS="modules/ngx_http_lua_module/src/ddebug.h \
modules/ngx_http_lua_module/src/ngx_http_lua_script.h \
modules/ngx_http_lua_module/src/ngx_http_lua_log.h \
modules/ngx_http_lua_module/src/ngx_http_lua_subrequest.h \
modules/ngx_http_lua_module/src/ngx_http_lua_ndk.h \
modules/ngx_http_lua_module/src/ngx_http_lua_control.h \
modules/ngx_http_lua_module/src/ngx_http_lua_time.h \
modules/ngx_http_lua_module/src/ngx_http_lua_string.h \
modules/ngx_http_lua_module/src/ngx_http_lua_misc.h \
modules/ngx_http_lua_module/src/ngx_http_lua_variable.h \
modules/ngx_http_lua_module/src/ngx_http_lua_output.h \
modules/ngx_http_lua_module/src/ngx_http_lua_headers.h \
modules/ngx_http_lua_module/src/ngx_http_lua_uri.h \
modules/ngx_http_lua_module/src/ngx_http_lua_req_body.h \
modules/ngx_http_lua_module/src/ngx_http_lua_args.h \
modules/ngx_http_lua_module/src/ngx_http_lua_ctx.h \
modules/ngx_http_lua_module/src/ngx_http_lua_regex.h \
modules/ngx_http_lua_module/src/ngx_http_lua_common.h \
modules/ngx_http_lua_module/src/ngx_http_lua_directive.h \
modules/ngx_http_lua_module/src/ngx_http_lua_headers_out.h \
modules/ngx_http_lua_module/src/ngx_http_lua_headers_in.h \
modules/ngx_http_lua_module/src/ngx_http_lua_consts.h \
modules/ngx_http_lua_module/src/ngx_http_lua_exception.h \
modules/ngx_http_lua_module/src/ngx_http_lua_util.h \
modules/ngx_http_lua_module/src/ngx_http_lua_cache.h \
modules/ngx_http_lua_module/src/ngx_http_lua_contentby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_rewriteby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_accessby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_setby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_capturefilter.h \
modules/ngx_http_lua_module/src/ngx_http_lua_clfactory.h \
modules/ngx_http_lua_module/src/ngx_http_lua_pcrefix.h \
modules/ngx_http_lua_module/src/ngx_http_lua_headerfilterby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_shdict.h \
modules/ngx_http_lua_module/src/ngx_http_lua_socket_tcp.h \
modules/ngx_http_lua_module/src/api/ngx_http_lua_api.h \
modules/ngx_http_lua_module/src/ngx_http_lua_logby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_sleep.h \
modules/ngx_http_lua_module/src/ngx_http_lua_coroutine.h \
modules/ngx_http_lua_module/src/ngx_http_lua_bodyfilterby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_initby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_initworkerby.h \
modules/ngx_http_lua_module/src/ngx_http_lua_socket_udp.h \
modules/ngx_http_lua_module/src/ngx_http_lua_req_method.h \
modules/ngx_http_lua_module/src/ngx_http_lua_phase.h \
modules/ngx_http_lua_module/src/ngx_http_lua_probe.h \
modules/ngx_http_lua_module/src/ngx_http_lua_uthread.h \
modules/ngx_http_lua_module/src/ngx_http_lua_timer.h \
modules/ngx_http_lua_module/src/ngx_http_lua_config.h \
modules/ngx_http_lua_module/src/ngx_http_lua_worker.h"
NGX_HTTP_TFS_MODULE="ngx_http_tfs_module"
NGX_HTTP_TFS_MODULE_DEPS="src/http/modules/tfs/ngx_http_tfs.h \
src/http/modules/tfs/ngx_http_tfs_errno.h \
src/http/modules/tfs/ngx_tfs_common.h \
src/http/modules/tfs/ngx_http_tfs_restful.h \
src/http/modules/tfs/ngx_http_tfs_restful.h \
src/http/modules/tfs/ngx_http_tfs_protocol.h \
src/http/modules/tfs/ngx_http_tfs_serialization.h \
src/http/modules/tfs/ngx_http_connection_pool.h \
src/http/modules/tfs/ngx_http_tfs_json.h \
src/http/modules/tfs/ngx_http_tfs_rc_server_info.h \
src/http/modules/tfs/ngx_http_tfs_raw_fsname.h \
src/http/modules/tfs/ngx_http_tfs_tair_helper.h \
src/http/modules/tfs/ngx_http_tfs_duplicate.h \
src/http/modules/tfs/ngx_http_tfs_block_cache.h \
src/http/modules/tfs/ngx_http_tfs_local_block_cache.h \
src/http/modules/tfs/ngx_http_tfs_remote_block_cache.h \
src/http/modules/tfs/ngx_http_tfs_timers.h \
src/http/modules/tfs/ngx_http_tfs_rc_server_message.h \
src/http/modules/tfs/ngx_http_tfs_name_server_message.h \
src/http/modules/tfs/ngx_http_tfs_data_server_message.h \
src/http/modules/tfs/ngx_http_tfs_root_server_message.h \
src/http/modules/tfs/ngx_http_tfs_meta_server_message.h \
src/http/modules/tfs/ngx_http_tfs_peer_connection.h \
src/http/modules/tfs/ngx_http_tfs_server_handler.h "
NGX_HTTP_TFS_MODULE_SRCS="src/http/modules/tfs/ngx_tfs_common.c \
src/http/modules/tfs/ngx_http_tfs.c \
src/http/modules/tfs/ngx_http_tfs_module.c \
src/http/modules/tfs/ngx_http_tfs_restful.c \
src/http/modules/tfs/ngx_http_tfs_serialization.c \
src/http/modules/tfs/ngx_http_connection_pool.c \
src/http/modules/tfs/ngx_http_tfs_json.c \
src/http/modules/tfs/ngx_http_tfs_rc_server_info.c \
src/http/modules/tfs/ngx_http_tfs_raw_fsname.c \
src/http/modules/tfs/ngx_http_tfs_tair_helper.c \
src/http/modules/tfs/ngx_http_tfs_duplicate.c \
src/http/modules/tfs/ngx_http_tfs_block_cache.c \
src/http/modules/tfs/ngx_http_tfs_local_block_cache.c \
src/http/modules/tfs/ngx_http_tfs_remote_block_cache.c \
src/http/modules/tfs/ngx_http_tfs_timers.c \
src/http/modules/tfs/ngx_http_tfs_rc_server_message.c \
src/http/modules/tfs/ngx_http_tfs_name_server_message.c \
src/http/modules/tfs/ngx_http_tfs_data_server_message.c \
src/http/modules/tfs/ngx_http_tfs_root_server_message.c \
src/http/modules/tfs/ngx_http_tfs_meta_server_message.c \
src/http/modules/tfs/ngx_http_tfs_peer_connection.c \
src/http/modules/tfs/ngx_http_tfs_server_handler.c "

View file

@ -0,0 +1,8 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_SUPPRESS_WARN . auto/have
have=NGX_SMP . auto/have

View file

@ -0,0 +1,130 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
### STUB
if [ $USE_THREADS != NO ]; then
cat << END
$0: error: the threads support is broken now.
END
exit 1
fi
###
echo
echo "Configuration summary"
#case $USE_THREADS in
# rfork) echo " + using rfork()ed threads" ;;
# pthreads) echo " + using libpthread threads library" ;;
# libthr) echo " + using FreeBSD libthr threads library" ;;
# libc_r) echo " + using FreeBSD libc_r threads library" ;;
# linuxthreads) echo " + using FreeBSD LinuxThreads port library" ;;
# NO) echo " + threads are not used" ;;
# *) echo " + using lib$USE_THREADS threads library" ;;
#esac
if [ $USE_PCRE = DISABLED ]; then
echo " + PCRE library is disabled"
else
case $PCRE in
YES) echo " + using system PCRE library" ;;
NONE) echo " + PCRE library is not used" ;;
*) echo " + using PCRE library: $PCRE" ;;
esac
fi
case $OPENSSL in
YES) echo " + using system OpenSSL library" ;;
NONE) echo " + OpenSSL library is not used" ;;
*) echo " + using OpenSSL library: $OPENSSL" ;;
esac
case $MD5 in
YES) echo " + md5: using $MD5_LIB library" ;;
NONE) echo " + md5 library is not used" ;;
NO) echo " + using builtin md5 code" ;;
*) echo " + using md5 library: $MD5" ;;
esac
case $SHA1 in
YES) echo " + sha1: using $SHA1_LIB library" ;;
NONE) echo " + sha1 library is not used" ;;
NO) echo " + sha1 library is not found" ;;
*) echo " + using sha1 library: $SHA1" ;;
esac
case $ZLIB in
YES) echo " + using system zlib library" ;;
NONE) echo " + zlib library is not used" ;;
*) echo " + using zlib library: $ZLIB" ;;
esac
case $NGX_LIBATOMIC in
YES) echo " + using system libatomic_ops library" ;;
NO) ;; # not used
*) echo " + using libatomic_ops library: $NGX_LIBATOMIC" ;;
esac
if [ $USE_JEMALLOC = NO ]; then
case $JEMALLOC in
NONE) echo " + jemalloc library is disabled" ;;
*) echo " + using jemalloc library: $JEMALLOC" ;;
esac
else
echo " + using system jemalloc library"
fi
echo
cat << END
nginx path prefix: "$NGX_PREFIX"
nginx binary file: "$NGX_SBIN_PATH"
nginx configuration prefix: "$NGX_CONF_PREFIX"
nginx configuration file: "$NGX_CONF_PATH"
nginx pid file: "$NGX_PID_PATH"
END
if test -n "$NGX_ERROR_LOG_PATH"; then
echo " nginx error log file: \"$NGX_ERROR_LOG_PATH\""
else
echo " nginx logs errors to stderr"
fi
cat << END
nginx http access log file: "$NGX_HTTP_LOG_PATH"
nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
END
if [ $NGX_DSO = YES ]; then
echo " nginx dso module path: \"$NGX_DSO_PATH\""
fi
if [ $HTTP_PROXY = YES ]; then
echo " nginx http proxy temporary files: \"$NGX_HTTP_PROXY_TEMP_PATH\""
fi
if [ $HTTP_FASTCGI = YES ]; then
echo " nginx http fastcgi temporary files: \"$NGX_HTTP_FASTCGI_TEMP_PATH\""
fi
if [ $HTTP_UWSGI = YES ]; then
echo " nginx http uwsgi temporary files: \"$NGX_HTTP_UWSGI_TEMP_PATH\""
fi
if [ $HTTP_SCGI = YES ]; then
echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
fi
echo "$NGX_POST_CONF_MSG"

View file

@ -0,0 +1,84 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type size ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for $ngx_type size
END
ngx_size=
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
#include <sys/time.h>
$NGX_INCLUDE_UNISTD_H
#include <signal.h>
#include <stdio.h>
#include <sys/resource.h>
$NGX_INCLUDE_INTTYPES_H
$NGX_INCLUDE_AUTO_CONFIG_H
int main() {
printf("%d", (int) sizeof($ngx_type));
return 0;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
ngx_size=`$NGX_AUTOTEST`
echo " $ngx_size bytes"
fi
rm -rf $NGX_AUTOTEST*
case $ngx_size in
4)
if [ "$ngx_type"="long" ]; then
ngx_max_value=2147483647L
else
ngx_max_value=2147483647
fi
ngx_max_len='(sizeof("-2147483648") - 1)'
;;
8)
if [ "$ngx_type"="long long" ]; then
ngx_max_value=9223372036854775807LL
else
ngx_max_value=9223372036854775807L
fi
ngx_max_len='(sizeof("-9223372036854775808") - 1)'
;;
*)
echo
echo "$0: error: can not detect $ngx_type size"
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
exit 1
esac

View file

@ -0,0 +1,77 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for $ngx_type
END
ngx_found=no
for ngx_try in $ngx_type $ngx_types
do
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <netinet/in.h>
$NGX_INCLUDE_INTTYPES_H
int main() {
$ngx_try i = 0;
return (int) i;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
if [ $ngx_try = $ngx_type ]; then
echo " found"
ngx_found=yes
else
echo ", $ngx_try used"
ngx_found=$ngx_try
fi
fi
rm -rf $NGX_AUTOTEST*
if [ $ngx_found = no ]; then
echo $ngx_n " $ngx_try not found$ngx_c"
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
else
break
fi
done
if [ $ngx_found = no ]; then
echo
echo "$0: error: can not define $ngx_type"
exit 1
fi
if [ $ngx_found != yes ]; then
echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
fi

View file

@ -0,0 +1,45 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for uintptr_t ...$ngx_c"
echo >> $NGX_AUTOCONF_ERR
echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR
found=no
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
$NGX_INTTYPES_H
int main() {
uintptr_t i = 0;
return (int) i;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
echo " uintptr_t found"
found=yes
else
echo $ngx_n " uintptr_t not found" $ngx_c
fi
rm -rf $NGX_AUTOTEST*
if [ $found = no ]; then
found="uint`expr 8 \* $ngx_ptr_size`_t"
echo ", $found used"
echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H
echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H
fi

View file

@ -0,0 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $ngx_param
#define $ngx_param $ngx_value
#endif
END

882
Dengine/tengine/auto/unix Executable file
View file

@ -0,0 +1,882 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_USER=${NGX_USER:-nobody}
if [ -z "$NGX_GROUP" ]; then
if [ $NGX_USER = nobody ]; then
if grep nobody /etc/group 2>&1 >/dev/null; then
echo "checking for nobody group ... found"
NGX_GROUP=nobody
else
echo "checking for nobody group ... not found"
if grep nogroup /etc/group 2>&1 >/dev/null; then
echo "checking for nogroup group ... found"
NGX_GROUP=nogroup
else
echo "checking for nogroup group ... not found"
NGX_GROUP=nobody
fi
fi
else
NGX_GROUP=$NGX_USER
fi
fi
ngx_feature="poll()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <poll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n; struct pollfd pl;
pl.fd = 0;
pl.events = 0;
pl.revents = 0;
n = poll(&pl, 1, 0);
if (n == -1) return 1"
. auto/feature
if [ $ngx_found = no ]; then
EVENT_POLL=NONE
fi
ngx_feature="/dev/poll"
ngx_feature_name="NGX_HAVE_DEVPOLL"
ngx_feature_run=no
ngx_feature_incs="#include <sys/devpoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n, dp; struct dvpoll dvp;
dp = 0;
dvp.dp_fds = NULL;
dvp.dp_nfds = 0;
dvp.dp_timeout = 0;
n = ioctl(dp, DP_POLL, &dvp);
if (n == -1) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
EVENT_FOUND=YES
fi
if test -z "$NGX_KQUEUE_CHECKED"; then
ngx_feature="kqueue"
ngx_feature_name="NGX_HAVE_KQUEUE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq; kq = kqueue()"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
ngx_feature="kqueue's NOTE_LOWAT"
ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct kevent kev;
kev.fflags = NOTE_LOWAT;"
. auto/feature
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
if ((kq = kqueue()) == -1) return 1;
kev.ident = 0;
kev.filter = EVFILT_TIMER;
kev.flags = EV_ADD|EV_ENABLE;
kev.fflags = 0;
kev.data = 1000;
kev.udata = 0;
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
if (kev.flags & EV_ERROR) return 1;"
. auto/feature
fi
fi
if [ "$NGX_SYSTEM" = "NetBSD" ]; then
# NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T
END
else
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T (void *)
END
fi
ngx_feature="crypt()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="crypt(\"test\", \"salt\");"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="crypt() in libcrypt"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=-lcrypt
. auto/feature
if [ $ngx_found = yes ]; then
CRYPT_LIB="-lcrypt"
fi
fi
ngx_feature="F_READAHEAD"
ngx_feature_name="NGX_HAVE_F_READAHEAD"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
. auto/feature
ngx_feature="posix_fadvise()"
ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
. auto/feature
ngx_feature="O_DIRECT"
ngx_feature_name="NGX_HAVE_O_DIRECT"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
. auto/feature
if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
fi
ngx_feature="F_NOCACHE"
ngx_feature_name="NGX_HAVE_F_NOCACHE"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
. auto/feature
ngx_feature="directio()"
ngx_feature_name="NGX_HAVE_DIRECTIO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="directio(0, DIRECTIO_ON);"
. auto/feature
ngx_feature="statfs()"
ngx_feature_name="NGX_HAVE_STATFS"
ngx_feature_run=no
ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
$NGX_INCLUDE_SYS_MOUNT_H
$NGX_INCLUDE_SYS_VFS_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct statfs fs;
statfs(\".\", &fs);"
. auto/feature
ngx_feature="statvfs()"
ngx_feature_name="NGX_HAVE_STATVFS"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/statvfs.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct statvfs fs;
statvfs(\".\", &fs);"
. auto/feature
ngx_feature="dlopen()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <dlfcn.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="dlopen(NULL, 0)"
. auto/feature
if [ $ngx_found != yes ]; then
ngx_feature="dlopen() in libdl"
ngx_feature_libs="-ldl"
. auto/feature
if [ $ngx_found = yes ]; then
NGX_LIBDL="-ldl"
else
if [ $NGX_DSO = YES] ; then
cat << END
dlopen(3) required by dso was not found, please disable dso (--without-dso).
END
fi
fi
fi
ngx_feature="sysinfo()"
ngx_feature_name="NGX_HAVE_SYSINFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/sysinfo.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct sysinfo s;
sysinfo(&s);"
. auto/feature
ngx_feature="getloadavg()"
ngx_feature_name="NGX_HAVE_GETLOADAVG"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="double loadavg[1];
getloadavg(loadavg, 1);"
. auto/feature
ngx_feature="/proc/meminfo"
ngx_feature_name="NGX_HAVE_PROC_MEMINFO"
ngx_feature_run=yes
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='int fd;
if (open("/proc/meminfo", O_RDONLY) == -1) return 1;'
. auto/feature
ngx_feature="sched_yield()"
ngx_feature_name="NGX_HAVE_SCHED_YIELD"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sched_yield()"
. auto/feature
if [ $ngx_found != yes ]; then
ngx_feature="sched_yield() in librt"
ngx_feature_libs="-lrt"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="SO_SETFIB"
ngx_feature_name="NGX_HAVE_SETFIB"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
. auto/feature
ngx_feature="SO_ACCEPTFILTER"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
. auto/feature
ngx_feature="TCP_DEFER_ACCEPT"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
. auto/feature
ngx_feature="TCP_KEEPIDLE"
ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
setsockopt(0, IPPROTO_TCP, TCP_KEEPINTVL, NULL, 0);
setsockopt(0, IPPROTO_TCP, TCP_KEEPCNT, NULL, 0)"
. auto/feature
ngx_feature="TCP_FASTOPEN"
ngx_feature_name="NGX_HAVE_TCP_FASTOPEN"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_FASTOPEN, NULL, 0)"
. auto/feature
ngx_feature="TCP_INFO"
ngx_feature_name="NGX_HAVE_TCP_INFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
struct tcp_info ti;
ti.tcpi_rtt = 0;
ti.tcpi_rttvar = 0;
ti.tcpi_snd_cwnd = 0;
ti.tcpi_rcv_space = 0;
getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
. auto/feature
ngx_feature="accept4()"
ngx_feature_name="NGX_HAVE_ACCEPT4"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
. auto/feature
if [ $NGX_FILE_AIO = YES ]; then
ngx_feature="kqueue AIO support"
ngx_feature_name="NGX_HAVE_FILE_AIO"
ngx_feature_run=no
ngx_feature_incs="#include <aio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n; struct aiocb iocb;
iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
n = aio_read(&iocb)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
elif [ $ngx_found = no ]; then
ngx_feature="Linux AIO support"
ngx_feature_name="NGX_HAVE_FILE_AIO"
ngx_feature_run=no
ngx_feature_incs="#include <linux/aio_abi.h>
#include <sys/syscall.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n = SYS_eventfd;
struct iocb iocb;
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
iocb.aio_flags = IOCB_FLAG_RESFD;
iocb.aio_resfd = -1;"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_EVENTFD . auto/have
CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
else
cat << END
$0: no supported file AIO was found
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
END
exit 1
fi
fi
fi
have=NGX_HAVE_UNIX_DOMAIN . auto/have
ngx_feature_libs=
# C types
ngx_type="int"; . auto/types/sizeof
ngx_type="long"; . auto/types/sizeof
ngx_type="long long"; . auto/types/sizeof
ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
# POSIX types
case "$NGX_AUTO_CONFIG_H" in
/*)
NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
;;
*)
NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
;;
esac
ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
. auto/types/sizeof
ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
. auto/types/uintptr_t
. auto/endianness
ngx_type="size_t"; . auto/types/sizeof
ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
ngx_type="off_t"; . auto/types/sizeof
ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
ngx_type="time_t"; . auto/types/sizeof
ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
# syscalls, libc calls and some features
if [ $NGX_IPV6 = YES ]; then
ngx_feature="AF_INET6"
ngx_feature_name="NGX_HAVE_INET6"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct sockaddr_in6 sin6;
sin6.sin6_family = AF_INET6;"
. auto/feature
fi
if [ $NGX_SYSLOG = YES ]; then
CORE_DEPS="$CORE_DEPS $SYSLOG_DEPS"
CORE_SRCS="$CORE_SRCS $SYSLOG_SRCS"
fi
if [ $NGX_BACKTRACE = YES ]; then
ngx_feature="BACKTRACE"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <execinfo.h>"
ngx_feature_path=
ngx_feature_test="void *buffer[10];
backtrace(buffer, sizeof(buffer) / sizeof(buffer[0]));"
. auto/feature
if [ $ngx_found = no ]; then
cat << END
$0: error: the backtrace module requires backtrace function.
You can either do not enable the module or update your libc library.
END
exit 1
fi
fi
ngx_feature="setproctitle()"
ngx_feature_name="NGX_HAVE_SETPROCTITLE"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_path=
ngx_feature_libs=$NGX_SETPROCTITLE_LIB
ngx_feature_test="setproctitle(\"test\");"
. auto/feature
ngx_feature="pread()"
ngx_feature_name="NGX_HAVE_PREAD"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
if (n == -1) return 1"
. auto/feature
ngx_feature="pwrite()"
ngx_feature_name="NGX_HAVE_PWRITE"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
if (n == -1) return 1"
. auto/feature
ngx_feature="sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='printf("%d", sys_nerr);'
. auto/feature
if [ $ngx_found = no ]; then
# Cygiwn defines _sys_nerr
ngx_feature="_sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='printf("%d", _sys_nerr);'
. auto/feature
fi
if [ $ngx_found = no ]; then
# Solaris has no sys_nerr
ngx_feature='maximum errno'
ngx_feature_name=NGX_SYS_NERR
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
#include <string.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='int n;
char *p;
for (n = 1; n < 1000; n++) {
errno = 0;
p = strerror(n);
if (errno == EINVAL
|| p == NULL
|| strncmp(p, "Unknown error", 13) == 0)
{
break;
}
}
printf("%d", n);'
. auto/feature
fi
ngx_feature="localtime_r()"
ngx_feature_name="NGX_HAVE_LOCALTIME_R"
ngx_feature_run=no
ngx_feature_incs="#include <time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
. auto/feature
ngx_feature="posix_memalign()"
ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
if (n != 0) return 1"
. auto/feature
ngx_feature="memalign()"
ngx_feature_name="NGX_HAVE_MEMALIGN"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>
#include <malloc.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="void *p; p = memalign(4096, 4096);
if (p == NULL) return 1"
. auto/feature
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
ngx_feature_name="NGX_HAVE_MAP_ANON"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/mman.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="void *p;
p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_SHARED, -1, 0);
if (p == MAP_FAILED) return 1;"
. auto/feature
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='void *p; int fd;
fd = open("/dev/zero", O_RDWR);
p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (p == MAP_FAILED) return 1;'
. auto/feature
ngx_feature="System V shared memory"
ngx_feature_name="NGX_HAVE_SYSVSHM"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/ipc.h>
#include <sys/shm.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int id;
id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
if (id == -1) return 1;
shmctl(id, IPC_RMID, NULL);"
. auto/feature
ngx_feature="POSIX semaphores"
ngx_feature_name="NGX_HAVE_POSIX_SEM"
ngx_feature_run=yes
ngx_feature_incs="#include <semaphore.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sem_t sem;
if (sem_init(&sem, 1, 0) == -1) return 1;
sem_destroy(&sem);"
. auto/feature
if [ $ngx_found = no ]; then
# Linux has POSIX semaphores in libpthread
ngx_feature="POSIX semaphores in libpthread"
ngx_feature_libs=-lpthread
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lpthread"
fi
fi
if [ $ngx_found = no ]; then
# Solaris has POSIX semaphores in librt
ngx_feature="POSIX semaphores in librt"
ngx_feature_libs=-lrt
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="struct msghdr.msg_control"
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct msghdr msg;
printf(\"%d\", (int) sizeof(msg.msg_control))"
. auto/feature
ngx_feature="ioctl(FIONBIO)"
ngx_feature_name="NGX_HAVE_FIONBIO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/ioctl.h>
#include <stdio.h>
$NGX_INCLUDE_SYS_FILIO_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)"
. auto/feature
ngx_feature="struct tm.tm_gmtoff"
ngx_feature_name="NGX_HAVE_GMTOFF"
ngx_feature_run=no
ngx_feature_incs="#include <time.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
printf(\"%d\", (int) tm.tm_gmtoff)"
. auto/feature
ngx_feature="struct dirent.d_namlen"
ngx_feature_name="NGX_HAVE_D_NAMLEN"
ngx_feature_run=no
ngx_feature_incs="#include <dirent.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
printf(\"%d\", (int) dir.d_namlen)"
. auto/feature
ngx_feature="struct dirent.d_type"
ngx_feature_name="NGX_HAVE_D_TYPE"
ngx_feature_run=no
ngx_feature_incs="#include <dirent.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
printf(\"%d\", (int) dir.d_type)"
. auto/feature
ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
. auto/feature
ngx_feature="openat(), fstatat()"
ngx_feature_name="NGX_HAVE_OPENAT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct stat sb;
openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
. auto/feature
if [ -f "/etc/resolv.conf" ]; then
have=NGX_RESOLVER_FILE
value=\"/etc/resolv.conf\"
. auto/define
fi
ngx_feature="getaddrinfo()"
ngx_feature_name="NGX_HAVE_GETADDRINFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='struct addrinfo *res;
if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
freeaddrinfo(res)'
. auto/feature

View file

@ -0,0 +1,112 @@
# syntax:
#
# user_agent $variable_name {
# default value;
# greedy name;
#
# name [([+|-]version) | (version1~version2)] value;
# }
user_agent $browser {
# default
default unknown;
# greedy
greedy Chrome;
greedy Safari;
greedy Firefox;
# name version value
# match version greater than 18.0[18.0,+OO]
Chrome 18.0+ chrome18;
# match version in[16.0,16.9999]
Chrome 17.0~17.9999 chrome17;
Chrome 16.0~16.9999 chrome16;
Chrome 15.0~15.9999 chrome15;
Chrome 14.0~14.9999 chrome14;
Chrome 13.0~13.9999 chrome13;
Chrome 12.0~12.9999 chrome12;
Chrome 11.0~11.9999 chrome11;
Chrome 10.0~10.9999 chrome10;
Chrome 0~0.9999 chrome_low;
# match version 4.0 exactly
ChromePlus 4.0 chromeplus4;
ChromePlus 0~3.9999 chromeplus;
Firebird 3.0~3.9999 firebird3;
Firebird 0.7~0.7.9999 firebird07;
Firebird 0.6~0.6.9999 firebird06;
Firefox 9.0~9.9999 firefox9;
Firefox 7.0~7.9999 firefox7;
Firefox 8.0~8.9999 firefox8;
Firefox 6.0~6.9999 firefox6;
Firefox 5.0~5.9999 firefox5;
Firefox 4.0~4.9999 firefox4;
Firefox 0~3.9999 firefox_low;
MSIE 10.0~10.9999 msie10;
MSIE 9.0~9.9999 msie9;
MSIE 8.0~8.9999 msie8;
MSIE 7.0~7.9999 msie7;
MSIE 6.0~6.9999 msie6;
# match version less than 5.9999[-OO,5.9999]
MSIE 5.9999- msie_low;
Maxthon 3.0~3.9999 maxthon3;
Maxthon 2.9999- maxthon_low;
Safari 419.9999- safari_low;
Safari 522.0~525.29.9999 safari3;
Safari 526.8~526.11.999 safari_dp1;
Safari 530.18.0~533.15.999 safari4;
Safari 533.16.0~533.17.999 safari501;
Safari 533.18.0~533.18.6 safari502;
Safari 6533.18.0~6533.18.5.99 safari502;
Safari 533.19.4~533.19.9 safari503;
Safari 533.20.0~533.20.27 safari504;
Safari 533.21~533.22 safari505;
Safari 7534.48~7534.48.9 safari51;
Safari 534.53~534.57 safari51;
Safari 8536.25~8536.9999 safari6;
# match all versions
Opera opera;
# mobile browsers
BlackBerry blackberry;
Blazer blazer;
'Maemo Browser' maemobrowser;
'Opera Mini' operamini;
'Opera Mobile' operamobile;
Skyfire skyfire;
UCWEB UCWEB;
}
user_agent $os {
default unknown;
iPad ipad;
iPhone iphone;
Symbian symbian;
MeeGo meego;
'Windows Phone' windowsphone;
Android android;
BlackBerry blackberry;
MIUI miui;
'Windows NT' 5.1 windowsxp;
'Windows NT' 6.1 windows7;
'Windows NT' 6.0 windowsvista;
linux linux;
unix unix;
FreeBSD freebsd;
Macintosh macos;
}

View file

@ -0,0 +1,25 @@
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

View file

@ -0,0 +1,24 @@
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

View file

@ -0,0 +1,109 @@
# This map is not a full koi8-r <> utf8 map: it does not contain
# box-drawing and some other characters. Besides this map contains
# several koi8-u and Byelorussian letters which are not in koi8-r.
# If you need a full and standard map, use contrib/unicode2nginx/koi-utf
# map instead.
charset_map koi8-r utf-8 {
80 E282AC ; # euro
95 E280A2 ; # bullet
9A C2A0 ; # &nbsp;
9E C2B7 ; # &middot;
A3 D191 ; # small yo
A4 D194 ; # small Ukrainian ye
A6 D196 ; # small Ukrainian i
A7 D197 ; # small Ukrainian yi
AD D291 ; # small Ukrainian soft g
AE D19E ; # small Byelorussian short u
B0 C2B0 ; # &deg;
B3 D081 ; # capital YO
B4 D084 ; # capital Ukrainian YE
B6 D086 ; # capital Ukrainian I
B7 D087 ; # capital Ukrainian YI
B9 E28496 ; # numero sign
BD D290 ; # capital Ukrainian soft G
BE D18E ; # capital Byelorussian short U
BF C2A9 ; # (C)
C0 D18E ; # small yu
C1 D0B0 ; # small a
C2 D0B1 ; # small b
C3 D186 ; # small ts
C4 D0B4 ; # small d
C5 D0B5 ; # small ye
C6 D184 ; # small f
C7 D0B3 ; # small g
C8 D185 ; # small kh
C9 D0B8 ; # small i
CA D0B9 ; # small j
CB D0BA ; # small k
CC D0BB ; # small l
CD D0BC ; # small m
CE D0BD ; # small n
CF D0BE ; # small o
D0 D0BF ; # small p
D1 D18F ; # small ya
D2 D180 ; # small r
D3 D181 ; # small s
D4 D182 ; # small t
D5 D183 ; # small u
D6 D0B6 ; # small zh
D7 D0B2 ; # small v
D8 D18C ; # small soft sign
D9 D18B ; # small y
DA D0B7 ; # small z
DB D188 ; # small sh
DC D18D ; # small e
DD D189 ; # small shch
DE D187 ; # small ch
DF D18A ; # small hard sign
E0 D0AE ; # capital YU
E1 D090 ; # capital A
E2 D091 ; # capital B
E3 D0A6 ; # capital TS
E4 D094 ; # capital D
E5 D095 ; # capital YE
E6 D0A4 ; # capital F
E7 D093 ; # capital G
E8 D0A5 ; # capital KH
E9 D098 ; # capital I
EA D099 ; # capital J
EB D09A ; # capital K
EC D09B ; # capital L
ED D09C ; # capital M
EE D09D ; # capital N
EF D09E ; # capital O
F0 D09F ; # capital P
F1 D0AF ; # capital YA
F2 D0A0 ; # capital R
F3 D0A1 ; # capital S
F4 D0A2 ; # capital T
F5 D0A3 ; # capital U
F6 D096 ; # capital ZH
F7 D092 ; # capital V
F8 D0AC ; # capital soft sign
F9 D0AB ; # capital Y
FA D097 ; # capital Z
FB D0A8 ; # capital SH
FC D0AD ; # capital E
FD D0A9 ; # capital SHCH
FE D0A7 ; # capital CH
FF D0AA ; # capital hard sign
}

View file

@ -0,0 +1,103 @@
charset_map koi8-r windows-1251 {
80 88 ; # euro
95 95 ; # bullet
9A A0 ; # &nbsp;
9E B7 ; # &middot;
A3 B8 ; # small yo
A4 BA ; # small Ukrainian ye
A6 B3 ; # small Ukrainian i
A7 BF ; # small Ukrainian yi
AD B4 ; # small Ukrainian soft g
AE A2 ; # small Byelorussian short u
B0 B0 ; # &deg;
B3 A8 ; # capital YO
B4 AA ; # capital Ukrainian YE
B6 B2 ; # capital Ukrainian I
B7 AF ; # capital Ukrainian YI
B9 B9 ; # numero sign
BD A5 ; # capital Ukrainian soft G
BE A1 ; # capital Byelorussian short U
BF A9 ; # (C)
C0 FE ; # small yu
C1 E0 ; # small a
C2 E1 ; # small b
C3 F6 ; # small ts
C4 E4 ; # small d
C5 E5 ; # small ye
C6 F4 ; # small f
C7 E3 ; # small g
C8 F5 ; # small kh
C9 E8 ; # small i
CA E9 ; # small j
CB EA ; # small k
CC EB ; # small l
CD EC ; # small m
CE ED ; # small n
CF EE ; # small o
D0 EF ; # small p
D1 FF ; # small ya
D2 F0 ; # small r
D3 F1 ; # small s
D4 F2 ; # small t
D5 F3 ; # small u
D6 E6 ; # small zh
D7 E2 ; # small v
D8 FC ; # small soft sign
D9 FB ; # small y
DA E7 ; # small z
DB F8 ; # small sh
DC FD ; # small e
DD F9 ; # small shch
DE F7 ; # small ch
DF FA ; # small hard sign
E0 DE ; # capital YU
E1 C0 ; # capital A
E2 C1 ; # capital B
E3 D6 ; # capital TS
E4 C4 ; # capital D
E5 C5 ; # capital YE
E6 D4 ; # capital F
E7 C3 ; # capital G
E8 D5 ; # capital KH
E9 C8 ; # capital I
EA C9 ; # capital J
EB CA ; # capital K
EC CB ; # capital L
ED CC ; # capital M
EE CD ; # capital N
EF CE ; # capital O
F0 CF ; # capital P
F1 DF ; # capital YA
F2 D0 ; # capital R
F3 D1 ; # capital S
F4 D2 ; # capital T
F5 D3 ; # capital U
F6 C6 ; # capital ZH
F7 C2 ; # capital V
F8 DC ; # capital soft sign
F9 DB ; # capital Y
FA C7 ; # capital Z
FB D8 ; # capital SH
FC DD ; # capital E
FD D9 ; # capital SHCH
FE D7 ; # capital CH
FF DA ; # capital hard sign
}

View file

@ -0,0 +1,91 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/font-woff woff;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/x-nokia-widget wgz;
application/vnd.android.package-archive apk;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View file

@ -0,0 +1,123 @@
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
# load modules compiled as Dynamic Shared Object (DSO)
#
#dso {
# load ngx_http_fastcgi_module.so;
# load ngx_http_rewrite_module.so;
#}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}

View file

@ -0,0 +1,16 @@
scgi_param REQUEST_METHOD $request_method;
scgi_param REQUEST_URI $request_uri;
scgi_param QUERY_STRING $query_string;
scgi_param CONTENT_TYPE $content_type;
scgi_param DOCUMENT_URI $document_uri;
scgi_param DOCUMENT_ROOT $document_root;
scgi_param SCGI 1;
scgi_param SERVER_PROTOCOL $server_protocol;
scgi_param HTTPS $https if_not_empty;
scgi_param REMOTE_ADDR $remote_addr;
scgi_param REMOTE_PORT $remote_port;
scgi_param SERVER_PORT $server_port;
scgi_param SERVER_NAME $server_name;

View file

@ -0,0 +1,16 @@
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;
uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param HTTPS $https if_not_empty;
uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;

View file

@ -0,0 +1,126 @@
# This map is not a full windows-1251 <> utf8 map: it does not
# contain Serbian and Macedonian letters. If you need a full map,
# use contrib/unicode2nginx/win-utf map instead.
charset_map windows-1251 utf-8 {
82 E2809A ; # single low-9 quotation mark
84 E2809E ; # double low-9 quotation mark
85 E280A6 ; # ellipsis
86 E280A0 ; # dagger
87 E280A1 ; # double dagger
88 E282AC ; # euro
89 E280B0 ; # per mille
91 E28098 ; # left single quotation mark
92 E28099 ; # right single quotation mark
93 E2809C ; # left double quotation mark
94 E2809D ; # right double quotation mark
95 E280A2 ; # bullet
96 E28093 ; # en dash
97 E28094 ; # em dash
99 E284A2 ; # trade mark sign
A0 C2A0 ; # &nbsp;
A1 D18E ; # capital Byelorussian short U
A2 D19E ; # small Byelorussian short u
A4 C2A4 ; # currency sign
A5 D290 ; # capital Ukrainian soft G
A6 C2A6 ; # borken bar
A7 C2A7 ; # section sign
A8 D081 ; # capital YO
A9 C2A9 ; # (C)
AA D084 ; # capital Ukrainian YE
AB C2AB ; # left-pointing double angle quotation mark
AC C2AC ; # not sign
AD C2AD ; # soft hypen
AE C2AE ; # (R)
AF D087 ; # capital Ukrainian YI
B0 C2B0 ; # &deg;
B1 C2B1 ; # plus-minus sign
B2 D086 ; # capital Ukrainian I
B3 D196 ; # small Ukrainian i
B4 D291 ; # small Ukrainian soft g
B5 C2B5 ; # micro sign
B6 C2B6 ; # pilcrow sign
B7 C2B7 ; # &middot;
B8 D191 ; # small yo
B9 E28496 ; # numero sign
BA D194 ; # small Ukrainian ye
BB C2BB ; # right-pointing double angle quotation mark
BF D197 ; # small Ukrainian yi
C0 D090 ; # capital A
C1 D091 ; # capital B
C2 D092 ; # capital V
C3 D093 ; # capital G
C4 D094 ; # capital D
C5 D095 ; # capital YE
C6 D096 ; # capital ZH
C7 D097 ; # capital Z
C8 D098 ; # capital I
C9 D099 ; # capital J
CA D09A ; # capital K
CB D09B ; # capital L
CC D09C ; # capital M
CD D09D ; # capital N
CE D09E ; # capital O
CF D09F ; # capital P
D0 D0A0 ; # capital R
D1 D0A1 ; # capital S
D2 D0A2 ; # capital T
D3 D0A3 ; # capital U
D4 D0A4 ; # capital F
D5 D0A5 ; # capital KH
D6 D0A6 ; # capital TS
D7 D0A7 ; # capital CH
D8 D0A8 ; # capital SH
D9 D0A9 ; # capital SHCH
DA D0AA ; # capital hard sign
DB D0AB ; # capital Y
DC D0AC ; # capital soft sign
DD D0AD ; # capital E
DE D0AE ; # capital YU
DF D0AF ; # capital YA
E0 D0B0 ; # small a
E1 D0B1 ; # small b
E2 D0B2 ; # small v
E3 D0B3 ; # small g
E4 D0B4 ; # small d
E5 D0B5 ; # small ye
E6 D0B6 ; # small zh
E7 D0B7 ; # small z
E8 D0B8 ; # small i
E9 D0B9 ; # small j
EA D0BA ; # small k
EB D0BB ; # small l
EC D0BC ; # small m
ED D0BD ; # small n
EE D0BE ; # small o
EF D0BF ; # small p
F0 D180 ; # small r
F1 D181 ; # small s
F2 D182 ; # small t
F3 D183 ; # small u
F4 D184 ; # small f
F5 D185 ; # small kh
F6 D186 ; # small ts
F7 D187 ; # small ch
F8 D188 ; # small sh
F9 D189 ; # small shch
FA D18A ; # small hard sign
FB D18B ; # small y
FC D18C ; # small soft sign
FD D18D ; # small e
FE D18E ; # small yu
FF D18F ; # small ya
}

114
Dengine/tengine/configure vendored Executable file
View file

@ -0,0 +1,114 @@
#!/bin/sh
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
LC_ALL=C
export LC_ALL
. auto/options
. auto/init
. auto/sources
test -d $NGX_OBJS || mkdir $NGX_OBJS
echo > $NGX_AUTO_HEADERS_H
echo > $NGX_AUTOCONF_ERR
echo "#define NGX_CONFIGURE \"$NGX_CONFIGURE\"" > $NGX_AUTO_CONFIG_H
if [ $NGX_DEBUG = YES ]; then
have=NGX_DEBUG . auto/have
fi
if [ $NGX_SYSLOG = YES ]; then
have=NGX_SYSLOG . auto/have
fi
if test -z "$NGX_PLATFORM"; then
echo "checking for OS"
NGX_SYSTEM=`uname -s 2>/dev/null`
NGX_RELEASE=`uname -r 2>/dev/null`
NGX_MACHINE=`uname -m 2>/dev/null`
echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"
NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
case "$NGX_SYSTEM" in
MINGW32_*)
NGX_PLATFORM=win32
;;
esac
else
echo "building for $NGX_PLATFORM"
NGX_SYSTEM=$NGX_PLATFORM
fi
. auto/cc/conf
if [ "$NGX_PLATFORM" != win32 ]; then
. auto/headers
fi
. auto/os/conf
if [ "$NGX_PLATFORM" != win32 ]; then
. auto/unix
fi
. auto/modules
. auto/lib/conf
case ".$NGX_PREFIX" in
.)
NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;
.!)
NGX_PREFIX=
;;
*)
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;
esac
if [ ".$NGX_CONF_PREFIX" != "." ]; then
have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define
fi
have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define
have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define
have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define
have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\""
. auto/define
have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\""
. auto/define
have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
. auto/define
. auto/make
. auto/lib/make
. auto/install
# STUB
. auto/stubs
have=NGX_USER value="\"$NGX_USER\"" . auto/define
have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define
. auto/summary

View file

@ -0,0 +1,21 @@
geo2nginx.pl by Andrei Nigmatulin
The perl script to convert CSV geoip database ( free download
at http://www.maxmind.com/app/geoip_country ) to format, suitable
for use by the ngx_http_geo_module.
unicode2nginx by Maxim Dounin
The perl script to convert unicode mappings ( available
at http://www.unicode.org/Public/MAPPINGS/ ) to the nginx
configuration file format.
Two generated full maps for windows-1251 and koi8-r.
vim by Evan Miller
Syntax highlighting of nginx configuration for vim, to be
placed into ~/.vim/.

View file

@ -0,0 +1,320 @@
DSO_CORE_DEPS=%%CORE_DEPS%%
DSO_HTTP_DEPS=%%HTTP_DEPS%%
DSO_ALL_INCS=%%ALL_INCS%%
ALL_INCS=
CORE_INCS=
HTTP_INCS=
CORE_DEPS=
HTTP_DEPS=
NGX_OBJS=objs
opt=
help=no
for option
do
opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
case "$option" in
-*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) value="" ;;
esac
case "$option" in
--help) help=yes ;;
-h) help=yes ;;
--dst=) NGX_DSO_PREFIX="!" ;;
--dst=*) NGX_DSO_PREFIX="$value" ;;
-d=*) NGX_DSO_PREFIX="$value" ;;
--add-module=*) NGX_DSO_ADDONS="$NGX_DSO_ADDONS $value" ;;
-a=*) NGX_DSO_ADDONS="$NGX_DSO_ADDONS $value" ;;
--nginx-include=*) NGX_INCLUDE_PATH="$value" ;;
-s=*) NGX_INCLUDE_PATH="$value" ;;
*)
echo "$0: error: invalid option \"$option\""
exit 1
;;
esac
done
if ! test -n "$option" ; then
help=yes
fi
if [ $help = yes ]; then
cat << END
-h, --help display this help and exit
-d, --dst=PATH set module installation path
-a, --add-module=PATH external module which will be compiled(absolute path)
-s, --nginx-include=SOURCE set nginx include path(absolute path)
END
exit 1
fi
# arg1 is addon dir
# arg2 is addon deps
# arg3 is addon src
generate_make () {
# mkdir build temp
cd $1
dso_binout=$ngx_addon_name
NGX_DSO_MAKEFILE=objs/Makefile
NGX_ADDON_DEPS=$2
cat << END > $NGX_DSO_MAKEFILE
CC = $CC
CFLAGS = $CFLAGS
CPP = $CPP
LINK = $LINK
CORE_LIBS = $CORE_LIBS
CORE_INCS = $CORE_INCS
HTTP_INCS = $HTTP_INCS
CORE_LINK = $CORE_LINK
NGX_LD_OPT = $NGX_LD_OPT
END
cat << END >> $NGX_DSO_MAKEFILE
ALL_INCS = $ALL_INCS
CORE_DEPS = $CORE_DEPS
HTTP_DEPS = $HTTP_DEPS
ADDON_DEPS = \$(CORE_DEPS) $NGX_ADDON_DEPS
END
if test -n "$NGX_LD_OPT$CORE_LIBS"; then
ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
fi
for ngx_src in $NGX_ADDON_SRCS
do
ngx_obj="objs/src/`basename \`dirname $ngx_src\``"
test -d $ngx_obj || mkdir -p $ngx_obj
ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_obj \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
ngx_dso_all_objs="$ngx_dso_all_objs $ngx_obj"
done
ngx_deps=`echo $ngx_dso_all_objs $ngx_res $LINK_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_objs=`echo $ngx_dso_all_objs \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_link=${CORE_LINK:+`echo $CORE_LINK \
| sed -e "s/\//$ngx_regex_dirsep%%/g" -e "s/^/$ngx_long_regex_cont/"`}
cat << END >> $NGX_DSO_MAKEFILE
$NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext}: $ngx_deps$ngx_spacer
\$(LINK) ${ngx_long_start}${ngx_binout} $NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext}$ngx_long_cont$ngx_objs$ngx_libs$ngx_link
$ngx_rcc
${ngx_long_end}
END
for ngx_src in $NGX_ADDON_SRCS
do
ngx_obj="objs/src/`basename \`dirname $ngx_src\``"
test -d $ngx_obj || mkdir -p $ngx_obj
ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` | sed -e "s#/#$ngx_regex_dirsep#g"`
ngx_obj=`echo $ngx_obj \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
ngx_src=`echo $ngx_src | sed -e "s#/#$ngx_regex_dirsep#g"`
cat << END >> $NGX_DSO_MAKEFILE
$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab\$(ALL_INCS)$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
make -f $NGX_DSO_MAKEFILE
if [ "$?" = '0' ]; then
if test -n "$NGX_DSO_PREFIX"; then
test ! -f $NGX_DSO_PREFIX${dso_binout}${ngx_soext} \
|| unlink $NGX_DSO_PREFIX${dso_binout}${ngx_soext}
echo copying $NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext} to $NGX_DSO_PREFIX
cp $NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext} $NGX_DSO_PREFIX
else
NGX_DSO_DEST=$NGX_PREFIX${ngx_dirsep}$NGX_DSO_PATH
[[ $NGX_DSO_PATH == /* ]] && NGX_DSO_DEST=$NGX_DSO_PATH
test ! -f $NGX_DSO_DEST${ngx_dirsep}${dso_binout}${ngx_soext} \
|| unlink $NGX_DSO_DEST${ngx_dirsep}${dso_binout}${ngx_soext}
echo copying $NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext} to $NGX_DSO_DEST
cp $NGX_OBJS${ngx_dirsep}${dso_binout}${ngx_soext} $NGX_DSO_DEST
fi
fi
}
if test -n "$NGX_DSO_ADDONS"; then
echo configuring additional modules
for dai in $DSO_ALL_INCS
do
ALL_INCS="$ALL_INCS $dai"
done
ALL_INCS="$ALL_INCS -I$NGX_INCLUDE_PATH"
for dcd in $DSO_CORE_DEPS
do
if test -n "$dcd"; then
case ".$dcd" in
./*)
CORE_DEPS="$CORE_DEPS $dcd"
;;
*)
CORE_DEPS="$CORE_DEPS $NGX_INCLUDE_PATH/$dcd"
;;
esac
fi
done
for dhd in $DSO_HTTP_DEPS
do
if test -n "$dhd"; then
case ".$dhd" in
./*)
HTTP_DEPS="$HTTP_DEPS $dhd"
;;
*)
HTTP_DEPS="$HTTP_DEPS $NGX_INCLUDE_PATH/$dhd"
;;
esac
fi
done
for ngx_addon_dir in $NGX_DSO_ADDONS
do
echo "adding module in $ngx_addon_dir"
if test -f $ngx_addon_dir/config; then
NGX_ADDON_SRCS=
NGX_ADDON_DEPS=
CORE_LIBS_TEMP=$CORE_LIBS
CORE_LIBS=
cd $ngx_addon_dir
CORE_INCS_TEMP=$CORE_INCS
HTTP_INCS_TEMP=$HTTP_INCS
CORE_LIBS_TEMP=$CORE_LIBS
CORE_INCS=
HTTP_INCS=
CORE_LIBS=
if test -d $NGX_OBJS; then
rm -rf $NGX_OBJS
fi
mkdir -p $NGX_OBJS/auto
touch $NGX_AUTOCONF_ERR
touch $NGX_AUTOTEST
touch $NGX_AUTO_CONFIG_H
cat << END > $NGX_OBJS/auto/feature
$ngx_feature_file
END
cat << END > $NGX_OBJS/auto/have
$ngx_have_file
END
cd $NGX_OBJS
. $ngx_addon_dir/config
dso_core_incs=`echo $CORE_INCS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
dso_http_incs=`echo $HTTP_INCS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
dso_core_libs=`echo $CORE_LIBS \
| sed -e "s/\//$ngx_regex_dirsep/g"`
if test -n "$dso_core_incs"; then
CORE_INCS="$CORE_INCS_TEMP -I $dso_core_incs"
else
CORE_INCS=$CORE_INCS_TEMP
fi
if test -n "$dso_http_incs"; then
HTTP_INCS="$HTTP_INCS_TEMP -I $dso_http_incs"
else
HTTP_INCS=$HTTP_INCS_TEMP
fi
if test -n "$dso_core_libs"; then
CORE_LIBS="$CORE_LIBS_TEMP $dso_core_libs"
else
CORE_LIBS=$CORE_LIBS_TEMP
fi
cd -
cd $ngx_addon_dir
echo " + $ngx_addon_name will be compiled"
generate_make $ngx_addon_dir $NGX_ADDON_DEPS $NGX_ADDON_SRCS $ngx_addon_name
else
echo "$0: error: no $ngx_addon_dir/config was found"
exit 1
fi
done
else
echo "please specify the module path"
exit 1
fi

View file

@ -0,0 +1,58 @@
#!/usr/bin/perl -w
# (c) Andrei Nigmatulin, 2005
#
# this script provided "as is", without any warranties. use it at your own risk.
#
# special thanx to Andrew Sitnikov for perl port
#
# this script converts CSV geoip database (free download at http://www.maxmind.com/app/geoip_country)
# to format, suitable for use with nginx_http_geo module (http://sysoev.ru/nginx)
#
# for example, line with ip range
#
# "62.16.68.0","62.16.127.255","1041253376","1041268735","RU","Russian Federation"
#
# will be converted to four subnetworks:
#
# 62.16.68.0/22 RU;
# 62.16.72.0/21 RU;
# 62.16.80.0/20 RU;
# 62.16.96.0/19 RU;
use warnings;
use strict;
while( <STDIN> ){
if (/"[^"]+","[^"]+","([^"]+)","([^"]+)","([^"]+)"/){
print_subnets($1, $2, $3);
}
}
sub print_subnets {
my ($a1, $a2, $c) = @_;
my $l;
while ($a1 <= $a2) {
for ($l = 0; ($a1 & (1 << $l)) == 0 && ($a1 + ((1 << ($l + 1)) - 1)) <= $a2; $l++){};
print long2ip($a1) . "/" . (32 - $l) . " " . $c . ";\n";
$a1 += (1 << $l);
}
}
sub long2ip {
my $ip = shift;
my $str = 0;
$str = ($ip & 255);
$ip >>= 8;
$str = ($ip & 255).".$str";
$ip >>= 8;
$str = ($ip & 255).".$str";
$ip >>= 8;
$str = ($ip & 255).".$str";
}

View file

@ -0,0 +1,91 @@
#!/usr/bin/python
"""usage: python stylechecker.py /path/to/the/c/code"""
import os
import sys
import string
import re
WHITE = '\033[97m'
CYAN = '\033[96m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
def check_file(file):
if re.search('\.[c|h]$', file) == None:
return
f = open(file)
i = 1
file_name_printed = False
for line in f:
line = line.replace('\n', '')
# check the number of columns greater than 80
if len(line) > 80:
if not file_name_printed:
print RED + file + ':' + ENDC
file_name_printed = True
print (GREEN + ' [>80]:' + BLUE + ' #%d(%d)' + WHITE + ':%s') % (i, len(line), line) + ENDC
# check the last space in the end of line
if re.match(r'.*\s$', line):
if not file_name_printed:
print RED + file + ':' + ENDC
file_name_printed = True
print (GREEN + ' [SPACE]:' + BLUE + ' #%d(%d)' + WHITE + ':%s') % (i, len(line), line) + ENDC
# check the TAB key
if string.find(line, '\t') >= 0:
if not file_name_printed:
print RED + file + ':' + ENDC
file_name_printed = True
print (YELLOW + ' [TAB]:' + BLUE + ' #%d(%d)' + WHITE + ':%s') % (i, len(line), line) + ENDC
# check blank lines
if line.isspace():
if not file_name_printed:
print RED + file + ':' + ENDC
file_name_printed = True
print (CYAN + ' [BLK]:' + BLUE + ' #%d(%d)' + WHITE + ':%s') % (i, len(line), line) + ENDC
i = i + 1
f.close()
def walk_dir(dir):
for root, dirs, files in os.walk(dir):
for f in files:
s = root + '/' + f
check_file(s)
for d in dirs:
walk_dir(d)
def usage():
print """
Usage: stylechecker.py file or dir
python stylechecker.py /path/to/the/c/code
or
python stylechecker.py /file/of/c/code """
sys.exit(1)
### main
if len(sys.argv) == 2:
PATH = sys.argv[1]
if os.path.isfile(PATH):
check_file(PATH)
elif os.path.isdir(PATH):
walk_dir(PATH)
else:
print RED + "Check the %s is file or dir" % PATH + ENDC
else:
usage()

View file

@ -0,0 +1,131 @@
charset_map koi8-r utf-8 {
80 E29480 ; # BOX DRAWINGS LIGHT HORIZONTAL
81 E29482 ; # BOX DRAWINGS LIGHT VERTICAL
82 E2948C ; # BOX DRAWINGS LIGHT DOWN AND RIGHT
83 E29490 ; # BOX DRAWINGS LIGHT DOWN AND LEFT
84 E29494 ; # BOX DRAWINGS LIGHT UP AND RIGHT
85 E29498 ; # BOX DRAWINGS LIGHT UP AND LEFT
86 E2949C ; # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
87 E294A4 ; # BOX DRAWINGS LIGHT VERTICAL AND LEFT
88 E294AC ; # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
89 E294B4 ; # BOX DRAWINGS LIGHT UP AND HORIZONTAL
8A E294BC ; # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
8B E29680 ; # UPPER HALF BLOCK
8C E29684 ; # LOWER HALF BLOCK
8D E29688 ; # FULL BLOCK
8E E2968C ; # LEFT HALF BLOCK
8F E29690 ; # RIGHT HALF BLOCK
90 E29691 ; # LIGHT SHADE
91 E29692 ; # MEDIUM SHADE
92 E29693 ; # DARK SHADE
93 E28CA0 ; # TOP HALF INTEGRAL
94 E296A0 ; # BLACK SQUARE
95 E28899 ; # BULLET OPERATOR
96 E2889A ; # SQUARE ROOT
97 E28988 ; # ALMOST EQUAL TO
98 E289A4 ; # LESS-THAN OR EQUAL TO
99 E289A5 ; # GREATER-THAN OR EQUAL TO
9A C2A0 ; # NO-BREAK SPACE
9B E28CA1 ; # BOTTOM HALF INTEGRAL
9C C2B0 ; # DEGREE SIGN
9D C2B2 ; # SUPERSCRIPT TWO
9E C2B7 ; # MIDDLE DOT
9F C3B7 ; # DIVISION SIGN
A0 E29590 ; # BOX DRAWINGS DOUBLE HORIZONTAL
A1 E29591 ; # BOX DRAWINGS DOUBLE VERTICAL
A2 E29592 ; # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
A3 D191 ; # CYRILLIC SMALL LETTER IO
A4 E29593 ; # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
A5 E29594 ; # BOX DRAWINGS DOUBLE DOWN AND RIGHT
A6 E29595 ; # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
A7 E29596 ; # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
A8 E29597 ; # BOX DRAWINGS DOUBLE DOWN AND LEFT
A9 E29598 ; # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
AA E29599 ; # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
AB E2959A ; # BOX DRAWINGS DOUBLE UP AND RIGHT
AC E2959B ; # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
AD E2959C ; # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
AE E2959D ; # BOX DRAWINGS DOUBLE UP AND LEFT
AF E2959E ; # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
B0 E2959F ; # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
B1 E295A0 ; # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
B2 E295A1 ; # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
B3 D081 ; # CYRILLIC CAPITAL LETTER IO
B4 E295A2 ; # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
B5 E295A3 ; # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
B6 E295A4 ; # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
B7 E295A5 ; # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
B8 E295A6 ; # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
B9 E295A7 ; # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
BA E295A8 ; # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
BB E295A9 ; # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
BC E295AA ; # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
BD E295AB ; # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
BE E295AC ; # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
BF C2A9 ; # COPYRIGHT SIGN
C0 D18E ; # CYRILLIC SMALL LETTER YU
C1 D0B0 ; # CYRILLIC SMALL LETTER A
C2 D0B1 ; # CYRILLIC SMALL LETTER BE
C3 D186 ; # CYRILLIC SMALL LETTER TSE
C4 D0B4 ; # CYRILLIC SMALL LETTER DE
C5 D0B5 ; # CYRILLIC SMALL LETTER IE
C6 D184 ; # CYRILLIC SMALL LETTER EF
C7 D0B3 ; # CYRILLIC SMALL LETTER GHE
C8 D185 ; # CYRILLIC SMALL LETTER HA
C9 D0B8 ; # CYRILLIC SMALL LETTER I
CA D0B9 ; # CYRILLIC SMALL LETTER SHORT I
CB D0BA ; # CYRILLIC SMALL LETTER KA
CC D0BB ; # CYRILLIC SMALL LETTER EL
CD D0BC ; # CYRILLIC SMALL LETTER EM
CE D0BD ; # CYRILLIC SMALL LETTER EN
CF D0BE ; # CYRILLIC SMALL LETTER O
D0 D0BF ; # CYRILLIC SMALL LETTER PE
D1 D18F ; # CYRILLIC SMALL LETTER YA
D2 D180 ; # CYRILLIC SMALL LETTER ER
D3 D181 ; # CYRILLIC SMALL LETTER ES
D4 D182 ; # CYRILLIC SMALL LETTER TE
D5 D183 ; # CYRILLIC SMALL LETTER U
D6 D0B6 ; # CYRILLIC SMALL LETTER ZHE
D7 D0B2 ; # CYRILLIC SMALL LETTER VE
D8 D18C ; # CYRILLIC SMALL LETTER SOFT SIGN
D9 D18B ; # CYRILLIC SMALL LETTER YERU
DA D0B7 ; # CYRILLIC SMALL LETTER ZE
DB D188 ; # CYRILLIC SMALL LETTER SHA
DC D18D ; # CYRILLIC SMALL LETTER E
DD D189 ; # CYRILLIC SMALL LETTER SHCHA
DE D187 ; # CYRILLIC SMALL LETTER CHE
DF D18A ; # CYRILLIC SMALL LETTER HARD SIGN
E0 D0AE ; # CYRILLIC CAPITAL LETTER YU
E1 D090 ; # CYRILLIC CAPITAL LETTER A
E2 D091 ; # CYRILLIC CAPITAL LETTER BE
E3 D0A6 ; # CYRILLIC CAPITAL LETTER TSE
E4 D094 ; # CYRILLIC CAPITAL LETTER DE
E5 D095 ; # CYRILLIC CAPITAL LETTER IE
E6 D0A4 ; # CYRILLIC CAPITAL LETTER EF
E7 D093 ; # CYRILLIC CAPITAL LETTER GHE
E8 D0A5 ; # CYRILLIC CAPITAL LETTER HA
E9 D098 ; # CYRILLIC CAPITAL LETTER I
EA D099 ; # CYRILLIC CAPITAL LETTER SHORT I
EB D09A ; # CYRILLIC CAPITAL LETTER KA
EC D09B ; # CYRILLIC CAPITAL LETTER EL
ED D09C ; # CYRILLIC CAPITAL LETTER EM
EE D09D ; # CYRILLIC CAPITAL LETTER EN
EF D09E ; # CYRILLIC CAPITAL LETTER O
F0 D09F ; # CYRILLIC CAPITAL LETTER PE
F1 D0AF ; # CYRILLIC CAPITAL LETTER YA
F2 D0A0 ; # CYRILLIC CAPITAL LETTER ER
F3 D0A1 ; # CYRILLIC CAPITAL LETTER ES
F4 D0A2 ; # CYRILLIC CAPITAL LETTER TE
F5 D0A3 ; # CYRILLIC CAPITAL LETTER U
F6 D096 ; # CYRILLIC CAPITAL LETTER ZHE
F7 D092 ; # CYRILLIC CAPITAL LETTER VE
F8 D0AC ; # CYRILLIC CAPITAL LETTER SOFT SIGN
F9 D0AB ; # CYRILLIC CAPITAL LETTER YERU
FA D097 ; # CYRILLIC CAPITAL LETTER ZE
FB D0A8 ; # CYRILLIC CAPITAL LETTER SHA
FC D0AD ; # CYRILLIC CAPITAL LETTER E
FD D0A9 ; # CYRILLIC CAPITAL LETTER SHCHA
FE D0A7 ; # CYRILLIC CAPITAL LETTER CHE
FF D0AA ; # CYRILLIC CAPITAL LETTER HARD SIGN
}

View file

@ -0,0 +1,45 @@
#!/usr/bin/perl -w
# Convert unicode mappings to nginx configuration file format.
# You may find useful mappings in various places, including
# unicode.org official site:
#
# http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT
# http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
# Needs perl 5.6 or later.
# Written by Maxim Dounin, mdounin@rambler-co.ru
###############################################################################
require 5.006;
while (<>) {
# Skip comments and empty lines
next if /^#/;
next if /^\s*$/;
chomp;
# Convert mappings
if (/^\s*0x(..)\s*0x(....)\s*(#.*)/) {
# Mapping <from-code> <unicode-code> "#" <unicode-name>
my $cs_code = $1;
my $un_code = $2;
my $un_name = $3;
# Produce UTF-8 sequence from character code;
my $un_utf8 = join('', map { sprintf("%02X", $_) } unpack("C*", pack("U", hex($un_code))));
print " $cs_code $un_utf8 ; $un_name\n";
} else {
warn "Unrecognized line: '$_'";
}
}
###############################################################################

View file

@ -0,0 +1,130 @@
charset_map windows-1251 utf-8 {
80 D082 ; #CYRILLIC CAPITAL LETTER DJE
81 D083 ; #CYRILLIC CAPITAL LETTER GJE
82 E2809A ; #SINGLE LOW-9 QUOTATION MARK
83 D193 ; #CYRILLIC SMALL LETTER GJE
84 E2809E ; #DOUBLE LOW-9 QUOTATION MARK
85 E280A6 ; #HORIZONTAL ELLIPSIS
86 E280A0 ; #DAGGER
87 E280A1 ; #DOUBLE DAGGER
88 E282AC ; #EURO SIGN
89 E280B0 ; #PER MILLE SIGN
8A D089 ; #CYRILLIC CAPITAL LETTER LJE
8B E280B9 ; #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
8C D08A ; #CYRILLIC CAPITAL LETTER NJE
8D D08C ; #CYRILLIC CAPITAL LETTER KJE
8E D08B ; #CYRILLIC CAPITAL LETTER TSHE
8F D08F ; #CYRILLIC CAPITAL LETTER DZHE
90 D192 ; #CYRILLIC SMALL LETTER DJE
91 E28098 ; #LEFT SINGLE QUOTATION MARK
92 E28099 ; #RIGHT SINGLE QUOTATION MARK
93 E2809C ; #LEFT DOUBLE QUOTATION MARK
94 E2809D ; #RIGHT DOUBLE QUOTATION MARK
95 E280A2 ; #BULLET
96 E28093 ; #EN DASH
97 E28094 ; #EM DASH
99 E284A2 ; #TRADE MARK SIGN
9A D199 ; #CYRILLIC SMALL LETTER LJE
9B E280BA ; #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
9C D19A ; #CYRILLIC SMALL LETTER NJE
9D D19C ; #CYRILLIC SMALL LETTER KJE
9E D19B ; #CYRILLIC SMALL LETTER TSHE
9F D19F ; #CYRILLIC SMALL LETTER DZHE
A0 C2A0 ; #NO-BREAK SPACE
A1 D08E ; #CYRILLIC CAPITAL LETTER SHORT U
A2 D19E ; #CYRILLIC SMALL LETTER SHORT U
A3 D088 ; #CYRILLIC CAPITAL LETTER JE
A4 C2A4 ; #CURRENCY SIGN
A5 D290 ; #CYRILLIC CAPITAL LETTER GHE WITH UPTURN
A6 C2A6 ; #BROKEN BAR
A7 C2A7 ; #SECTION SIGN
A8 D081 ; #CYRILLIC CAPITAL LETTER IO
A9 C2A9 ; #COPYRIGHT SIGN
AA D084 ; #CYRILLIC CAPITAL LETTER UKRAINIAN IE
AB C2AB ; #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
AC C2AC ; #NOT SIGN
AD C2AD ; #SOFT HYPHEN
AE C2AE ; #REGISTERED SIGN
AF D087 ; #CYRILLIC CAPITAL LETTER YI
B0 C2B0 ; #DEGREE SIGN
B1 C2B1 ; #PLUS-MINUS SIGN
B2 D086 ; #CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
B3 D196 ; #CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
B4 D291 ; #CYRILLIC SMALL LETTER GHE WITH UPTURN
B5 C2B5 ; #MICRO SIGN
B6 C2B6 ; #PILCROW SIGN
B7 C2B7 ; #MIDDLE DOT
B8 D191 ; #CYRILLIC SMALL LETTER IO
B9 E28496 ; #NUMERO SIGN
BA D194 ; #CYRILLIC SMALL LETTER UKRAINIAN IE
BB C2BB ; #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
BC D198 ; #CYRILLIC SMALL LETTER JE
BD D085 ; #CYRILLIC CAPITAL LETTER DZE
BE D195 ; #CYRILLIC SMALL LETTER DZE
BF D197 ; #CYRILLIC SMALL LETTER YI
C0 D090 ; #CYRILLIC CAPITAL LETTER A
C1 D091 ; #CYRILLIC CAPITAL LETTER BE
C2 D092 ; #CYRILLIC CAPITAL LETTER VE
C3 D093 ; #CYRILLIC CAPITAL LETTER GHE
C4 D094 ; #CYRILLIC CAPITAL LETTER DE
C5 D095 ; #CYRILLIC CAPITAL LETTER IE
C6 D096 ; #CYRILLIC CAPITAL LETTER ZHE
C7 D097 ; #CYRILLIC CAPITAL LETTER ZE
C8 D098 ; #CYRILLIC CAPITAL LETTER I
C9 D099 ; #CYRILLIC CAPITAL LETTER SHORT I
CA D09A ; #CYRILLIC CAPITAL LETTER KA
CB D09B ; #CYRILLIC CAPITAL LETTER EL
CC D09C ; #CYRILLIC CAPITAL LETTER EM
CD D09D ; #CYRILLIC CAPITAL LETTER EN
CE D09E ; #CYRILLIC CAPITAL LETTER O
CF D09F ; #CYRILLIC CAPITAL LETTER PE
D0 D0A0 ; #CYRILLIC CAPITAL LETTER ER
D1 D0A1 ; #CYRILLIC CAPITAL LETTER ES
D2 D0A2 ; #CYRILLIC CAPITAL LETTER TE
D3 D0A3 ; #CYRILLIC CAPITAL LETTER U
D4 D0A4 ; #CYRILLIC CAPITAL LETTER EF
D5 D0A5 ; #CYRILLIC CAPITAL LETTER HA
D6 D0A6 ; #CYRILLIC CAPITAL LETTER TSE
D7 D0A7 ; #CYRILLIC CAPITAL LETTER CHE
D8 D0A8 ; #CYRILLIC CAPITAL LETTER SHA
D9 D0A9 ; #CYRILLIC CAPITAL LETTER SHCHA
DA D0AA ; #CYRILLIC CAPITAL LETTER HARD SIGN
DB D0AB ; #CYRILLIC CAPITAL LETTER YERU
DC D0AC ; #CYRILLIC CAPITAL LETTER SOFT SIGN
DD D0AD ; #CYRILLIC CAPITAL LETTER E
DE D0AE ; #CYRILLIC CAPITAL LETTER YU
DF D0AF ; #CYRILLIC CAPITAL LETTER YA
E0 D0B0 ; #CYRILLIC SMALL LETTER A
E1 D0B1 ; #CYRILLIC SMALL LETTER BE
E2 D0B2 ; #CYRILLIC SMALL LETTER VE
E3 D0B3 ; #CYRILLIC SMALL LETTER GHE
E4 D0B4 ; #CYRILLIC SMALL LETTER DE
E5 D0B5 ; #CYRILLIC SMALL LETTER IE
E6 D0B6 ; #CYRILLIC SMALL LETTER ZHE
E7 D0B7 ; #CYRILLIC SMALL LETTER ZE
E8 D0B8 ; #CYRILLIC SMALL LETTER I
E9 D0B9 ; #CYRILLIC SMALL LETTER SHORT I
EA D0BA ; #CYRILLIC SMALL LETTER KA
EB D0BB ; #CYRILLIC SMALL LETTER EL
EC D0BC ; #CYRILLIC SMALL LETTER EM
ED D0BD ; #CYRILLIC SMALL LETTER EN
EE D0BE ; #CYRILLIC SMALL LETTER O
EF D0BF ; #CYRILLIC SMALL LETTER PE
F0 D180 ; #CYRILLIC SMALL LETTER ER
F1 D181 ; #CYRILLIC SMALL LETTER ES
F2 D182 ; #CYRILLIC SMALL LETTER TE
F3 D183 ; #CYRILLIC SMALL LETTER U
F4 D184 ; #CYRILLIC SMALL LETTER EF
F5 D185 ; #CYRILLIC SMALL LETTER HA
F6 D186 ; #CYRILLIC SMALL LETTER TSE
F7 D187 ; #CYRILLIC SMALL LETTER CHE
F8 D188 ; #CYRILLIC SMALL LETTER SHA
F9 D189 ; #CYRILLIC SMALL LETTER SHCHA
FA D18A ; #CYRILLIC SMALL LETTER HARD SIGN
FB D18B ; #CYRILLIC SMALL LETTER YERU
FC D18C ; #CYRILLIC SMALL LETTER SOFT SIGN
FD D18D ; #CYRILLIC SMALL LETTER E
FE D18E ; #CYRILLIC SMALL LETTER YU
FF D18F ; #CYRILLIC SMALL LETTER YA
}

View file

@ -0,0 +1,4 @@
au BufRead,BufNewFile *.nginx set ft=nginx
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
au BufRead,BufNewFile nginx.conf set ft=nginx

View file

@ -0,0 +1,11 @@
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=
" cindent actually works for nginx' simple file structure
setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#

View file

@ -0,0 +1,703 @@
" Vim syntax file
" Language: nginx.conf
if exists("b:current_syntax")
finish
end
setlocal iskeyword+=.
setlocal iskeyword+=/
setlocal iskeyword+=:
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
syn match ngxComment ' *#.*$'
syn keyword ngxBoolean on
syn keyword ngxBoolean off
syn keyword ngxDirectiveBlock http contained
syn keyword ngxDirectiveBlock mail contained
syn keyword ngxDirectiveBlock events contained
syn keyword ngxDirectiveBlock server contained
syn keyword ngxDirectiveBlock types contained
syn keyword ngxDirectiveBlock location contained
syn keyword ngxDirectiveBlock upstream contained
syn keyword ngxDirectiveBlock charset_map contained
syn keyword ngxDirectiveBlock limit_except contained
syn keyword ngxDirectiveBlock if contained
syn keyword ngxDirectiveBlock geo contained
syn keyword ngxDirectiveBlock map contained
syn keyword ngxDirectiveImportant include
syn keyword ngxDirectiveImportant root
syn keyword ngxDirectiveImportant server
syn keyword ngxDirectiveImportant server_name
syn keyword ngxDirectiveImportant listen
syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass
syn keyword ngxDirectiveImportant fastcgi_pass
syn keyword ngxDirectiveImportant try_files
syn keyword ngxDirectiveControl break
syn keyword ngxDirectiveControl return
syn keyword ngxDirectiveControl rewrite
syn keyword ngxDirectiveControl set
syn keyword ngxDirectiveError error_page
syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any
syn keyword ngxDirective accept_mutex
syn keyword ngxDirective accept_mutex_delay
syn keyword ngxDirective access_log
syn keyword ngxDirective add_after_body
syn keyword ngxDirective add_before_body
syn keyword ngxDirective add_header
syn keyword ngxDirective addition_types
syn keyword ngxDirective aio
syn keyword ngxDirective alias
syn keyword ngxDirective allow
syn keyword ngxDirective ancient_browser
syn keyword ngxDirective ancient_browser_value
syn keyword ngxDirective auth_basic
syn keyword ngxDirective auth_basic_user_file
syn keyword ngxDirective auth_http
syn keyword ngxDirective auth_http_header
syn keyword ngxDirective auth_http_timeout
syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_localtime
syn keyword ngxDirective charset
syn keyword ngxDirective charset_types
syn keyword ngxDirective client_body_buffer_size
syn keyword ngxDirective client_body_in_file_only
syn keyword ngxDirective client_body_in_single_buffer
syn keyword ngxDirective client_body_temp_path
syn keyword ngxDirective client_body_timeout
syn keyword ngxDirective client_header_buffer_size
syn keyword ngxDirective client_header_timeout
syn keyword ngxDirective client_max_body_size
syn keyword ngxDirective connection_pool_size
syn keyword ngxDirective create_full_put_path
syn keyword ngxDirective daemon
syn keyword ngxDirective dav_access
syn keyword ngxDirective dav_methods
syn keyword ngxDirective debug_connection
syn keyword ngxDirective debug_points
syn keyword ngxDirective default_type
syn keyword ngxDirective degradation
syn keyword ngxDirective degrade
syn keyword ngxDirective deny
syn keyword ngxDirective devpoll_changes
syn keyword ngxDirective devpoll_events
syn keyword ngxDirective directio
syn keyword ngxDirective directio_alignment
syn keyword ngxDirective empty_gif
syn keyword ngxDirective env
syn keyword ngxDirective epoll_events
syn keyword ngxDirective error_log
syn keyword ngxDirective eventport_events
syn keyword ngxDirective expires
syn keyword ngxDirective fastcgi_bind
syn keyword ngxDirective fastcgi_buffer_size
syn keyword ngxDirective fastcgi_buffers
syn keyword ngxDirective fastcgi_busy_buffers_size
syn keyword ngxDirective fastcgi_cache
syn keyword ngxDirective fastcgi_cache_key
syn keyword ngxDirective fastcgi_cache_methods
syn keyword ngxDirective fastcgi_cache_min_uses
syn keyword ngxDirective fastcgi_cache_path
syn keyword ngxDirective fastcgi_cache_use_stale
syn keyword ngxDirective fastcgi_cache_valid
syn keyword ngxDirective fastcgi_catch_stderr
syn keyword ngxDirective fastcgi_connect_timeout
syn keyword ngxDirective fastcgi_hide_header
syn keyword ngxDirective fastcgi_ignore_client_abort
syn keyword ngxDirective fastcgi_ignore_headers
syn keyword ngxDirective fastcgi_index
syn keyword ngxDirective fastcgi_intercept_errors
syn keyword ngxDirective fastcgi_max_temp_file_size
syn keyword ngxDirective fastcgi_next_upstream
syn keyword ngxDirective fastcgi_param
syn keyword ngxDirective fastcgi_pass_header
syn keyword ngxDirective fastcgi_pass_request_body
syn keyword ngxDirective fastcgi_pass_request_headers
syn keyword ngxDirective fastcgi_read_timeout
syn keyword ngxDirective fastcgi_send_lowat
syn keyword ngxDirective fastcgi_send_timeout
syn keyword ngxDirective fastcgi_split_path_info
syn keyword ngxDirective fastcgi_store
syn keyword ngxDirective fastcgi_store_access
syn keyword ngxDirective fastcgi_temp_file_write_size
syn keyword ngxDirective fastcgi_temp_path
syn keyword ngxDirective fastcgi_upstream_fail_timeout
syn keyword ngxDirective fastcgi_upstream_max_fails
syn keyword ngxDirective flv
syn keyword ngxDirective geoip_city
syn keyword ngxDirective geoip_country
syn keyword ngxDirective google_perftools_profiles
syn keyword ngxDirective gzip
syn keyword ngxDirective gzip_buffers
syn keyword ngxDirective gzip_comp_level
syn keyword ngxDirective gzip_disable
syn keyword ngxDirective gzip_hash
syn keyword ngxDirective gzip_http_version
syn keyword ngxDirective gzip_min_length
syn keyword ngxDirective gzip_no_buffer
syn keyword ngxDirective gzip_proxied
syn keyword ngxDirective gzip_static
syn keyword ngxDirective gzip_types
syn keyword ngxDirective gzip_vary
syn keyword ngxDirective gzip_window
syn keyword ngxDirective if_modified_since
syn keyword ngxDirective ignore_invalid_headers
syn keyword ngxDirective image_filter
syn keyword ngxDirective image_filter_buffer
syn keyword ngxDirective image_filter_jpeg_quality
syn keyword ngxDirective image_filter_transparency
syn keyword ngxDirective imap_auth
syn keyword ngxDirective imap_capabilities
syn keyword ngxDirective imap_client_buffer
syn keyword ngxDirective index
syn keyword ngxDirective ip_hash
syn keyword ngxDirective keepalive_requests
syn keyword ngxDirective keepalive_timeout
syn keyword ngxDirective kqueue_changes
syn keyword ngxDirective kqueue_events
syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective limit_zone
syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout
syn keyword ngxDirective lock_file
syn keyword ngxDirective log_format
syn keyword ngxDirective log_not_found
syn keyword ngxDirective log_subrequest
syn keyword ngxDirective map_hash_bucket_size
syn keyword ngxDirective map_hash_max_size
syn keyword ngxDirective master_process
syn keyword ngxDirective memcached_bind
syn keyword ngxDirective memcached_buffer_size
syn keyword ngxDirective memcached_connect_timeout
syn keyword ngxDirective memcached_next_upstream
syn keyword ngxDirective memcached_read_timeout
syn keyword ngxDirective memcached_send_timeout
syn keyword ngxDirective memcached_upstream_fail_timeout
syn keyword ngxDirective memcached_upstream_max_fails
syn keyword ngxDirective merge_slashes
syn keyword ngxDirective min_delete_depth
syn keyword ngxDirective modern_browser
syn keyword ngxDirective modern_browser_value
syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept
syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events
syn keyword ngxDirective open_file_cache_min_uses
syn keyword ngxDirective open_file_cache_valid
syn keyword ngxDirective open_log_file_cache
syn keyword ngxDirective output_buffers
syn keyword ngxDirective override_charset
syn keyword ngxDirective perl
syn keyword ngxDirective perl_modules
syn keyword ngxDirective perl_require
syn keyword ngxDirective perl_set
syn keyword ngxDirective pid
syn keyword ngxDirective pop3_auth
syn keyword ngxDirective pop3_capabilities
syn keyword ngxDirective port_in_redirect
syn keyword ngxDirective postpone_gzipping
syn keyword ngxDirective postpone_output
syn keyword ngxDirective protocol
syn keyword ngxDirective proxy
syn keyword ngxDirective proxy_bind
syn keyword ngxDirective proxy_buffer
syn keyword ngxDirective proxy_buffer_size
syn keyword ngxDirective proxy_buffering
syn keyword ngxDirective proxy_buffers
syn keyword ngxDirective proxy_busy_buffers_size
syn keyword ngxDirective proxy_cache
syn keyword ngxDirective proxy_cache_key
syn keyword ngxDirective proxy_cache_methods
syn keyword ngxDirective proxy_cache_min_uses
syn keyword ngxDirective proxy_cache_path
syn keyword ngxDirective proxy_cache_use_stale
syn keyword ngxDirective proxy_cache_valid
syn keyword ngxDirective proxy_connect_timeout
syn keyword ngxDirective proxy_headers_hash_bucket_size
syn keyword ngxDirective proxy_headers_hash_max_size
syn keyword ngxDirective proxy_hide_header
syn keyword ngxDirective proxy_ignore_client_abort
syn keyword ngxDirective proxy_ignore_headers
syn keyword ngxDirective proxy_intercept_errors
syn keyword ngxDirective proxy_max_temp_file_size
syn keyword ngxDirective proxy_method
syn keyword ngxDirective proxy_next_upstream
syn keyword ngxDirective proxy_pass_error_message
syn keyword ngxDirective proxy_pass_header
syn keyword ngxDirective proxy_pass_request_body
syn keyword ngxDirective proxy_pass_request_headers
syn keyword ngxDirective proxy_read_timeout
syn keyword ngxDirective proxy_redirect
syn keyword ngxDirective proxy_send_lowat
syn keyword ngxDirective proxy_send_timeout
syn keyword ngxDirective proxy_set_body
syn keyword ngxDirective proxy_set_header
syn keyword ngxDirective proxy_ssl_session_reuse
syn keyword ngxDirective proxy_store
syn keyword ngxDirective proxy_store_access
syn keyword ngxDirective proxy_temp_file_write_size
syn keyword ngxDirective proxy_temp_path
syn keyword ngxDirective proxy_timeout
syn keyword ngxDirective proxy_upstream_fail_timeout
syn keyword ngxDirective proxy_upstream_max_fails
syn keyword ngxDirective random_index
syn keyword ngxDirective read_ahead
syn keyword ngxDirective real_ip_header
syn keyword ngxDirective recursive_error_pages
syn keyword ngxDirective request_pool_size
syn keyword ngxDirective reset_timedout_connection
syn keyword ngxDirective resolver
syn keyword ngxDirective resolver_timeout
syn keyword ngxDirective rewrite_log
syn keyword ngxDirective rtsig_overflow_events
syn keyword ngxDirective rtsig_overflow_test
syn keyword ngxDirective rtsig_overflow_threshold
syn keyword ngxDirective rtsig_signo
syn keyword ngxDirective satisfy
syn keyword ngxDirective secure_link_secret
syn keyword ngxDirective send_lowat
syn keyword ngxDirective send_timeout
syn keyword ngxDirective sendfile
syn keyword ngxDirective sendfile_max_chunk
syn keyword ngxDirective server_name_in_redirect
syn keyword ngxDirective server_names_hash_bucket_size
syn keyword ngxDirective server_names_hash_max_size
syn keyword ngxDirective server_tokens
syn keyword ngxDirective set_real_ip_from
syn keyword ngxDirective smtp_auth
syn keyword ngxDirective smtp_capabilities
syn keyword ngxDirective smtp_client_buffer
syn keyword ngxDirective smtp_greeting_delay
syn keyword ngxDirective so_keepalive
syn keyword ngxDirective source_charset
syn keyword ngxDirective ssi
syn keyword ngxDirective ssi_ignore_recycled_buffers
syn keyword ngxDirective ssi_min_file_chunk
syn keyword ngxDirective ssi_silent_errors
syn keyword ngxDirective ssi_types
syn keyword ngxDirective ssi_value_length
syn keyword ngxDirective ssl
syn keyword ngxDirective ssl_certificate
syn keyword ngxDirective ssl_certificate_key
syn keyword ngxDirective ssl_ciphers
syn keyword ngxDirective ssl_client_certificate
syn keyword ngxDirective ssl_crl
syn keyword ngxDirective ssl_dhparam
syn keyword ngxDirective ssl_engine
syn keyword ngxDirective ssl_prefer_server_ciphers
syn keyword ngxDirective ssl_protocols
syn keyword ngxDirective ssl_session_cache
syn keyword ngxDirective ssl_session_timeout
syn keyword ngxDirective ssl_verify_client
syn keyword ngxDirective ssl_verify_depth
syn keyword ngxDirective starttls
syn keyword ngxDirective stub_status
syn keyword ngxDirective sub_filter
syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay
syn keyword ngxDirective tcp_nopush
syn keyword ngxDirective thread_stack_size
syn keyword ngxDirective timeout
syn keyword ngxDirective timer_resolution
syn keyword ngxDirective types_hash_bucket_size
syn keyword ngxDirective types_hash_max_size
syn keyword ngxDirective underscores_in_headers
syn keyword ngxDirective uninitialized_variable_warn
syn keyword ngxDirective use
syn keyword ngxDirective user
syn keyword ngxDirective userid
syn keyword ngxDirective userid_domain
syn keyword ngxDirective userid_expires
syn keyword ngxDirective userid_mark
syn keyword ngxDirective userid_name
syn keyword ngxDirective userid_p3p
syn keyword ngxDirective userid_path
syn keyword ngxDirective userid_service
syn keyword ngxDirective valid_referers
syn keyword ngxDirective variables_hash_bucket_size
syn keyword ngxDirective variables_hash_max_size
syn keyword ngxDirective worker_connections
syn keyword ngxDirective worker_cpu_affinity
syn keyword ngxDirective worker_priority
syn keyword ngxDirective worker_processes
syn keyword ngxDirective worker_rlimit_core
syn keyword ngxDirective worker_rlimit_nofile
syn keyword ngxDirective worker_rlimit_sigpending
syn keyword ngxDirective worker_threads
syn keyword ngxDirective working_directory
syn keyword ngxDirective xclient
syn keyword ngxDirective xml_entities
syn keyword ngxDirective xslt_stylesheet
syn keyword ngxDirective xslt_types
" 3rd party module list:
" http://wiki.nginx.org/Nginx3rdPartyModules
" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
syn keyword ngxDirectiveThirdParty set_from_accept_language
" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveThirdParty accesskey
syn keyword ngxDirectiveThirdParty accesskey_arg
syn keyword ngxDirectiveThirdParty accesskey_hashmethod
syn keyword ngxDirectiveThirdParty accesskey_signature
" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>
" HTTP Basic Authentication using PAM.
syn keyword ngxDirectiveThirdParty auth_pam
syn keyword ngxDirectiveThirdParty auth_pam_service_name
" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
" Module adding ability to purge content from FastCGI and proxy caches.
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
syn keyword ngxDirectiveThirdParty proxy_cache_purge
" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>
" HTTP 1.1 chunked-encoding request body support for Nginx.
syn keyword ngxDirectiveThirdParty chunkin
syn keyword ngxDirectiveThirdParty chunkin_keepalive
syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
syn keyword ngxDirectiveThirdParty chunkin_resume
" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>
" Generates simple circle images with the colors and size specified in the URL.
syn keyword ngxDirectiveThirdParty circle_gif
syn keyword ngxDirectiveThirdParty circle_gif_max_radius
syn keyword ngxDirectiveThirdParty circle_gif_min_radius
syn keyword ngxDirectiveThirdParty circle_gif_step_radius
" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>
" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
syn keyword ngxDirectiveThirdParty drizzle_dbname
syn keyword ngxDirectiveThirdParty drizzle_keepalive
syn keyword ngxDirectiveThirdParty drizzle_module_header
syn keyword ngxDirectiveThirdParty drizzle_pass
syn keyword ngxDirectiveThirdParty drizzle_query
syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
syn keyword ngxDirectiveThirdParty drizzle_server
" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>
" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
syn keyword ngxDirectiveThirdParty echo
syn keyword ngxDirectiveThirdParty echo_after_body
syn keyword ngxDirectiveThirdParty echo_before_body
syn keyword ngxDirectiveThirdParty echo_blocking_sleep
syn keyword ngxDirectiveThirdParty echo_duplicate
syn keyword ngxDirectiveThirdParty echo_end
syn keyword ngxDirectiveThirdParty echo_exec
syn keyword ngxDirectiveThirdParty echo_flush
syn keyword ngxDirectiveThirdParty echo_foreach_split
syn keyword ngxDirectiveThirdParty echo_location
syn keyword ngxDirectiveThirdParty echo_location_async
syn keyword ngxDirectiveThirdParty echo_read_request_body
syn keyword ngxDirectiveThirdParty echo_request_body
syn keyword ngxDirectiveThirdParty echo_reset_timer
syn keyword ngxDirectiveThirdParty echo_sleep
syn keyword ngxDirectiveThirdParty echo_subrequest
syn keyword ngxDirectiveThirdParty echo_subrequest_async
" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
" Privides options for start/stop events.
syn keyword ngxDirectiveThirdParty on_start
syn keyword ngxDirectiveThirdParty on_stop
" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>
" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
syn keyword ngxDirectiveThirdParty max_connections
syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>
" Like the built-in autoindex module, but fancier.
syn keyword ngxDirectiveThirdParty fancyindex
syn keyword ngxDirectiveThirdParty fancyindex_exact_size
syn keyword ngxDirectiveThirdParty fancyindex_footer
syn keyword ngxDirectiveThirdParty fancyindex_header
syn keyword ngxDirectiveThirdParty fancyindex_localtime
syn keyword ngxDirectiveThirdParty fancyindex_readme
syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
" Country code lookups via the MaxMind GeoIP API.
syn keyword ngxDirectiveThirdParty geoip_country_file
" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>
" Set and clear input and output headers...more than "add"!
syn keyword ngxDirectiveThirdParty more_clear_headers
syn keyword ngxDirectiveThirdParty more_clear_input_headers
syn keyword ngxDirectiveThirdParty more_set_headers
syn keyword ngxDirectiveThirdParty more_set_input_headers
" HTTP Push Module <http://pushmodule.slact.net/>
" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
syn keyword ngxDirectiveThirdParty push_buffer_size
syn keyword ngxDirectiveThirdParty push_listener
syn keyword ngxDirectiveThirdParty push_message_timeout
syn keyword ngxDirectiveThirdParty push_queue_messages
syn keyword ngxDirectiveThirdParty push_sender
" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>
" Redis <http://code.google.com/p/redis/> support.>
syn keyword ngxDirectiveThirdParty redis_bind
syn keyword ngxDirectiveThirdParty redis_buffer_size
syn keyword ngxDirectiveThirdParty redis_connect_timeout
syn keyword ngxDirectiveThirdParty redis_next_upstream
syn keyword ngxDirectiveThirdParty redis_pass
syn keyword ngxDirectiveThirdParty redis_read_timeout
syn keyword ngxDirectiveThirdParty redis_send_timeout
" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>
" Embedding SpiderMonkey. Nearly full port on Perl module.
syn keyword ngxDirectiveThirdParty js
syn keyword ngxDirectiveThirdParty js_filter
syn keyword ngxDirectiveThirdParty js_filter_types
syn keyword ngxDirectiveThirdParty js_load
syn keyword ngxDirectiveThirdParty js_maxmem
syn keyword ngxDirectiveThirdParty js_require
syn keyword ngxDirectiveThirdParty js_set
syn keyword ngxDirectiveThirdParty js_utf8
" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
" Log the time it took to process each request.
syn keyword ngxDirectiveThirdParty log_request_speed_filter
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
syn keyword ngxDirectiveThirdParty memc_buffer_size
syn keyword ngxDirectiveThirdParty memc_cmds_allowed
syn keyword ngxDirectiveThirdParty memc_connect_timeout
syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
syn keyword ngxDirectiveThirdParty memc_next_upstream
syn keyword ngxDirectiveThirdParty memc_pass
syn keyword ngxDirectiveThirdParty memc_read_timeout
syn keyword ngxDirectiveThirdParty memc_send_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.
syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
syn keyword ngxDirectiveThirdParty mogilefs_domain
syn keyword ngxDirectiveThirdParty mogilefs_methods
syn keyword ngxDirectiveThirdParty mogilefs_noverify
syn keyword ngxDirectiveThirdParty mogilefs_pass
syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
syn keyword ngxDirectiveThirdParty mogilefs_tracker
" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
syn keyword ngxDirectiveThirdParty mp4
" Nginx Notice Module <http://xph.us/software/nginx-notice/>
" Serve static file to POST requests.
syn keyword ngxDirectiveThirdParty notice
syn keyword ngxDirectiveThirdParty notice_type
" Phusion Passenger <http://www.modrails.com/documentation.html>
" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
syn keyword ngxDirectiveThirdParty passenger_base_uri
syn keyword ngxDirectiveThirdParty passenger_default_user
syn keyword ngxDirectiveThirdParty passenger_enabled
syn keyword ngxDirectiveThirdParty passenger_log_level
syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
syn keyword ngxDirectiveThirdParty passenger_max_pool_size
syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
syn keyword ngxDirectiveThirdParty passenger_root
syn keyword ngxDirectiveThirdParty passenger_ruby
syn keyword ngxDirectiveThirdParty passenger_use_global_queue
syn keyword ngxDirectiveThirdParty passenger_user_switching
syn keyword ngxDirectiveThirdParty rack_env
syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_env
syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_spawn_method
" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>
" Help ngx_drizzle and other DBD modules emit JSON data.
syn keyword ngxDirectiveThirdParty rds_json
syn keyword ngxDirectiveThirdParty rds_json_content_type
syn keyword ngxDirectiveThirdParty rds_json_format
syn keyword ngxDirectiveThirdParty rds_json_ret
" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>
" This module provides an HTTP interface to RRDtool's graphing facilities.
syn keyword ngxDirectiveThirdParty rrd_graph
syn keyword ngxDirectiveThirdParty rrd_graph_root
" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>
" Create expiring links.
syn keyword ngxDirectiveThirdParty secure_download
syn keyword ngxDirectiveThirdParty secure_download_fail_location
syn keyword ngxDirectiveThirdParty secure_download_path_mode
syn keyword ngxDirectiveThirdParty secure_download_secret
" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>
" Module adding ability to cache static files.
syn keyword ngxDirectiveThirdParty slowfs_big_file_size
syn keyword ngxDirectiveThirdParty slowfs_cache
syn keyword ngxDirectiveThirdParty slowfs_cache_key
syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
syn keyword ngxDirectiveThirdParty slowfs_cache_path
syn keyword ngxDirectiveThirdParty slowfs_cache_purge
syn keyword ngxDirectiveThirdParty slowfs_cache_valid
syn keyword ngxDirectiveThirdParty slowfs_temp_path
" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>
" Whitespace remover.
syn keyword ngxDirectiveThirdParty strip
" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>
" A filter module which can do both regular expression and fixed string substitutions on response bodies.
syn keyword ngxDirectiveThirdParty subs_filter
syn keyword ngxDirectiveThirdParty subs_filter_types
" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>
" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
syn keyword ngxDirectiveThirdParty supervisord
syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
syn keyword ngxDirectiveThirdParty supervisord_name
syn keyword ngxDirectiveThirdParty supervisord_start
syn keyword ngxDirectiveThirdParty supervisord_stop
" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>
" Parses multipart/form-data allowing arbitrary handling of uploaded files.
syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
syn keyword ngxDirectiveThirdParty upload_buffer_size
syn keyword ngxDirectiveThirdParty upload_cleanup
syn keyword ngxDirectiveThirdParty upload_limit_rate
syn keyword ngxDirectiveThirdParty upload_max_file_size
syn keyword ngxDirectiveThirdParty upload_max_output_body_len
syn keyword ngxDirectiveThirdParty upload_max_part_header_len
syn keyword ngxDirectiveThirdParty upload_pass
syn keyword ngxDirectiveThirdParty upload_pass_args
syn keyword ngxDirectiveThirdParty upload_pass_form_field
syn keyword ngxDirectiveThirdParty upload_set_form_field
syn keyword ngxDirectiveThirdParty upload_store
syn keyword ngxDirectiveThirdParty upload_store_access
" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>
" Tracks and reports upload progress.
syn keyword ngxDirectiveThirdParty report_uploads
syn keyword ngxDirectiveThirdParty track_uploads
syn keyword ngxDirectiveThirdParty upload_progress
syn keyword ngxDirectiveThirdParty upload_progress_content_type
syn keyword ngxDirectiveThirdParty upload_progress_header
syn keyword ngxDirectiveThirdParty upload_progress_json_output
syn keyword ngxDirectiveThirdParty upload_progress_template
" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>
" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
syn keyword ngxDirectiveThirdParty fair
syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>
" Select backend based on Consistent hash ring.
syn keyword ngxDirectiveThirdParty consistent_hash
" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
" Provides simple upstream load distribution by hashing a configurable variable.
syn keyword ngxDirectiveThirdParty hash
syn keyword ngxDirectiveThirdParty hash_again
" XSS Module <http://github.com/agentzh/xss-nginx-module>
" Native support for cross-site scripting (XSS) in an nginx.
syn keyword ngxDirectiveThirdParty xss_callback_arg
syn keyword ngxDirectiveThirdParty xss_get
syn keyword ngxDirectiveThirdParty xss_input_types
syn keyword ngxDirectiveThirdParty xss_output_type
" uWSGI Module <http://wiki.nginx.org/HttpUwsgiModule>
" Allows Nginx to interact with uWSGI processes and control what parameters are passed to the process.
syn keyword ngxDirectiveThirdParty uwsgi_bind
syn keyword ngxDirectiveThirdParty uwsgi_buffer_size
syn keyword ngxDirectiveThirdParty uwsgi_buffering
syn keyword ngxDirectiveThirdParty uwsgi_buffers
syn keyword ngxDirectiveThirdParty uwsgi_busy_buffers_size
syn keyword ngxDirectiveThirdParty uwsgi_cache
syn keyword ngxDirectiveThirdParty uwsgi_cache_bypass
syn keyword ngxDirectiveThirdParty uwsgi_cache_key
syn keyword ngxDirectiveThirdParty uwsgi_cache_lock
syn keyword ngxDirectiveThirdParty uwsgi_cache_lock_timeout
syn keyword ngxDirectiveThirdParty uwsgi_cache_methods
syn keyword ngxDirectiveThirdParty uwsgi_cache_min_uses
syn keyword ngxDirectiveThirdParty uwsgi_cache_path
syn keyword ngxDirectiveThirdParty uwsgi_cache_use_stale
syn keyword ngxDirectiveThirdParty uwsgi_cache_valid
syn keyword ngxDirectiveThirdParty uwsgi_connect_timeout
syn keyword ngxDirectiveThirdParty uwsgi_hide_header
syn keyword ngxDirectiveThirdParty uwsgi_ignore_client_abort
syn keyword ngxDirectiveThirdParty uwsgi_ignore_headers
syn keyword ngxDirectiveThirdParty uwsgi_intercept_errors
syn keyword ngxDirectiveThirdParty uwsgi_max_temp_file_size
syn keyword ngxDirectiveThirdParty uwsgi_modifier1
syn keyword ngxDirectiveThirdParty uwsgi_modifier2
syn keyword ngxDirectiveThirdParty uwsgi_next_upstream
syn keyword ngxDirectiveThirdParty uwsgi_no_cache
syn keyword ngxDirectiveThirdParty uwsgi_param
syn keyword ngxDirectiveThirdParty uwsgi_pass
syn keyword ngxDirectiveThirdParty uwsgi_pass_header
syn keyword ngxDirectiveThirdParty uwsgi_pass_request_body
syn keyword ngxDirectiveThirdParty uwsgi_pass_request_headers
syn keyword ngxDirectiveThirdParty uwsgi_read_timeout
syn keyword ngxDirectiveThirdParty uwsgi_send_timeout
syn keyword ngxDirectiveThirdParty uwsgi_store
syn keyword ngxDirectiveThirdParty uwsgi_store_access
syn keyword ngxDirectiveThirdParty uwsgi_string
syn keyword ngxDirectiveThirdParty uwsgi_temp_file_write_size
syn keyword ngxDirectiveThirdParty uwsgi_temp_path
" highlight
hi link ngxComment Comment
hi link ngxVariable Identifier
hi link ngxVariableBlock Identifier
hi link ngxVariableString PreProc
hi link ngxBlock Normal
hi link ngxString String
hi link ngxBoolean Boolean
hi link ngxDirectiveBlock Statement
hi link ngxDirectiveImportant Type
hi link ngxDirectiveControl Keyword
hi link ngxDirectiveError Constant
hi link ngxDirectiveDeprecated Error
hi link ngxDirective Identifier
hi link ngxDirectiveThirdParty Special
let b:current_syntax = "nginx"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,36 @@
Name
====
* backtrace module
Description
===========
* It can be used to dump backtrace of nginx in case a worker process exits abnormally, e.g. when some signal is received (SIGABR, SIGBUS, SIGFPE, SIGILL, SIGIOT, SIGSEGV). It's quite handy for debugging purpose.
* This module requires the backtrace(3) function in glibc. You can't enable it on systems lack of this function (FreeBSD, Darwin).
Directives
==========
backtrace_log
-------------
**Syntax**: *backtrace_log log_path*
**Default**: *backtrace_log error.log*
**Context**: *main*
Specify the log file name of backtrace.
backtrace_log /path/to/backtrace.log
backtrace_max_stack_size
------------------------
**Syntax**: *backtrace_max_stack_size size*
**Default**: *backtrace_max_stack_size 30*
**Context**: *main*
Specify the maximum stack depth for backtrace

View file

@ -0,0 +1,162 @@
Name
====
* Dynamic Module Loading Support (**DSO**)
Description
===========
* You can choose which functionalities to include by selecting a set of modules. A module will be compiled as a Dynamic Shared Object (**DSO**) that exists from the main tengine binary. So you don't have to recompile tengine when you want to add or enable a functionality to it.
* If you want to enable a standard module, you can enable it via configure's option while compiling tengine, for instance, --with-http\_example_module or --with-http\_example\_module=shared. Run *./configure --help* for more details.
* The maximum of dynamically loaded modules is limited to 128.
* For now, only HTTP modules can be dynamically loaded.
* This feature is tested only on Linux/FreeBSD/MacOS.
Example
===========
worker_processes 1;
dso {
load ngx_http_lua_module.so;
load ngx_http_memcached_module.so;
}
events {
worker_connections 1024;
}
Directives
==========
path
------------------------
**Syntax**: *path path*
**Default**: *NGX\_PREFIX/modules*
**Context**: *dso*
This directive specifies the default path (prefix) of DSO modules.
Example:
path /home/dso/module;
Sets the default path to */home/dso/module*.
load
------------------------
**Syntax**: *load [module_name] \[module_path]*
**Default**: *none*
**Context**: *dso*
The **load** directive loads the shared object file and enables the module. *module\_name* is the name of the DSO module, and *module\_path* is the path of the DSO module.
The order in which the module is searched is as follows:
* the absolute path.
* relative path to the prefix specified by the 'path' directive.
* relative path to the default path (NGX\_PREFIX/modules or path which is specified by the '--dso-path' configure option).
Example:
load ngx_http_empty_gif_module ngx_http_empty_gif_module.so;
load ngx_http_test_module;
load ngx_http_test2_module.so;
It will load the ngx\_http\_empty\_gif\_module from ngx\_http\_empty\_gif\_module.so, ngx\_http\_test_module and ngx\_http\_test2\_module from ngx\_http\_test\_module.so and ngx\_http\_test2\_module.so.
module_stub
-------------
**Syntax**: *module_stub module_name*
**Default**: *none*
**Context**: *dso*
This directive can insert a module into nginx's module array in order (see conf/module\_stubs for more details). Note it will change the module runtime order. This directive does not need to be used in most cases. Don't use it or edit the *conf/module\_stubs* file unless you know what you are doing.
Example:
module_stub ngx_core_module;
module_stub ngx_errlog_module;
module_stub ngx_conf_module;
module_stub ngx_events_module;
module_stub ngx_event_core_module;
module_stub ngx_epoll_module;
module_stub ngx_openssl_module;
module_stub ngx_http_module;
module_stub ngx_http_core_module;
.......................
module_stub ngx_http_addition_filter_module;
module_stub ngx_http_my_filter_module;
It will place ngx\_http\_my\_filter\_module before ngx\_http\_addition\_filter\_module.
include
-------------
**Syntax**: *include file_name*
**Default**: *none*
**Context**: *dso*
Specifies a file which contains the module stubs (via the **module_stub** directive).
Example:
include module_stubs;
It will load conf/module_stubs and define the loading order of the modules (via the **module\_stub** directive).
How to compile a module
===========
Standard module
------------------------
If you want to enable a standard module after you compiled and installed tengine, you can take these steps as following.
* enable the standard module you wanted in shared mode, for example:
$ ./configure --with-http_sub_module=shared
* compile it:
$ make
* install the shared object (*.so):
$ make dso_install
It will copy the *.so files to the destination, or you can copy the files you want (in objs/modules) manually to the modules directory.
Third party module
------------------------
You can use the __dso_tool__ located in the directory of nginx binary to compile a third party module.
Example:
./dso_tool --add-module=/home/dso/lua-nginx-module
It will compile the ngx_lua module into a shared object, and install it to the default module path. You can specify the destination directory you want install to by the **--dst** option.

View file

@ -0,0 +1,164 @@
模块名
====
* 动态加载模块
描述
===========
* 这个模块主要是用来运行时动态加载模块而不用每次都要重新编译Tengine.
* 如果你想要编译官方模块为动态模块你需要在configure的时候加上类似这样的指令(--with-http\_xxx_module),./configure --help可以看到更多的细节.
* 如果只想要安装官方模块为动态模块(不安装Nginx)那么就只需要configure之后执行 make dso_install命令.
* 动态加载模块的个数限制为128个.
* 如果已经加载的动态模块有修改那么必须重起Tengine才会生效.
* 只支持HTTP模块.
* 模块 在Linux/FreeeBSD/MacOS下测试成功.
例子
===========
worker_processes 1;
dso {
load ngx_http_lua_module.so;
load ngx_http_memcached_module.so;
}
events {
worker_connections 1024;
}
指令
==========
path
------------------------
**Syntax**: *path path*
**Default**: *none*
**Context**: *dso*
path 主要是设置默认的动态模块加载路径。
例子:
path /home/dso/module/;
设置默认的动态模块加载路径为/home/dso/module/.
load
------------------------
**Syntax**: *load [module_name] \[module_path]*
**Default**: *none*
**Context**: *dso*
load命令用于在指定的路径(module\_path),将指定的模块(module\_name)动态加载到Nginx中。其中module\_path和module\_name可以只写一个,如果没有module\_path参数那么默认path是 $(modulename).so.如果没有module\_name参数那么默认name就是module\_path删除掉".so"后缀.
对于module\_path的路径查找这里是严格按照下面的顺序的
1 module\_path指定的是绝对路径。
2 相对于dso\_path设置的相对路径.
3 相对于默认的加载路径的相对路径(NGX\_PREFIX/modules或者说configure时通过--dso-path设置的路径).
例子:
load ngx_http_empty_gif_module ngx_http_empty_gif_module.so;
load ngx_http_test_module;
load ngx_http_test2_module.so;
将会从ngx\_http\_empty\_gif\_module.so.加载empty\_gif模块。以及从ngx\_http\_test\_module.so加载ngx\_http\_test\_module模块.第三条指令是从ngx\_http\_test2\_module.so加载ngx\_http\_test2\_module模块.
module_stub
-------------
**Syntax**: *module_stub module_name*
**Default**: *none*
**Context**: *dso*
这个指令主要是将你需要的动态模块插入到你所需要的位置(可以看conf/module\_stubs这个文件),这个命令要很小心使用,因为它将会改变你的模块的运行时顺序(在Nginx中模块都是有严格顺序的).而大多数时候这个命令都是不需要设置的。
例子:
module_stub ngx_core_module;
module_stub ngx_errlog_module;
module_stub ngx_conf_module;
module_stub ngx_events_module;
module_stub ngx_event_core_module;
module_stub ngx_epoll_module;
module_stub ngx_openssl_module;
module_stub ngx_http_module;
module_stub ngx_http_core_module;
.......................
module_stub ngx_http_addition_filter_module;
module_stub ngx_http_my_filter_module;
上面这个例子将会插入my\_filter模块到addition\_filter之前执行。
include
-------------
**Syntax**: *include file_name*
**Default**: *none*
**Context**: *dso*
include命令主要用于指定一个文件这个文件里面包含了对应模块顺序(module_stub指令),有关于module\_stub指令可以看下面的module\_stubs部分.
例子:
include module_stubs
将会加载conf/module_stubs这个文件这个文件主要是由(module_stub指令组成).
如何编译动态模块
===========
官方模块
------------------------
如果你想要在安装完Tengine之后编译官方模块为动态模块那么你需要按照如下的步骤:
* 在configure的时候打开你想要编译的模块.
$ ./configure --with-http_sub_module=shared
* 编译它.
$ make
* 安装动态模块.
$ make dso_install
它将会复制动态库文件到你的动态模块目录,或者你也可以手工拷贝动态模块文件(文件是在objs/modules)到你想要加载的目录.
第三方模块
------------------------
你能够使用dso_tool(在Nginx安装目录的sbin下)这个工具来编译第三方模块.
例子:
./dso_tool --add-module=/home/dso/lua-nginx-module
将会编译ngx\_lua模块为动态库然后安装到默认的模块路径.如果你想要安装到指定位置,那么需要指定--dst选项(更多的选项请使用dso_tool -h查看).

View file

@ -0,0 +1,115 @@
# concat 模块
## 介绍
该模块类似于apache中的mod_concat模块用于合并多个文件在一个响应报文中。
请求参数需要用两个问号('??')例如:
http://example.com/??style1.css,style2.css,foo/style3.css
参数中某位置只包含一个‘?’,则'?'后表示文件的版本,例如:
http://example.com/??style1.css,style2.css,foo/style3.css?v=102234
## 配置
location /static/css/ {
concat on;
concat_max_files 20;
}
location /static/js/ {
concat on;
concat_max_files 30;
}
## 指令
**concat** `on` | `off`
**默认:** `concat off`
**上下文:** `http, server, location`
在配置的地方使模块有效(失效)
<br/>
<br/>
**concat_types** `MIME types`
**默认:** `concat_types: application/x-javascript text/css`
**上下文:** `http, server, location`
定义配置的[MIME types](http://en.wikipedia.org/wiki/MIME_type)以及 "application/x-javascript" 是可以被接受
<br/>
<br/>
**concat_unique** `on` | `off`
**默认:** `concat_unique on`
**上下文:** `http, server, location`
定义是否只接受在[MIME types]中的相同类型的文件,例如:
http://example.com/static/??foo.css,bar/foobaz.js
如果配置为 'concat_unique on' 那么将返回400如果配置为'concat_unique off'
那么将合并两个文件。
<br/>
<br/>
**concat\_max\_files** `number`
**默认:** `concat_max_files 10`
**上下文:** `http, server, location`
定义最大能接受的文件数量。
<br/>
<br/>
**concat_delimiter** string
**默认:** 无
**上下文** 'http, server, location'
定义在文件之间添加分隔符,例如
http://example.com/??1.js,2.js
如果配置为**concat_delimiter "\n"**响应会在1.js和2.js两个文件之间插入一个换行符('\n')
<br/>
<br/>
**concat_ignore_file_error** 'on | off'
**默认** 'concat_ignore_file_error off'
**上下文** 'http, server, location'
定义模块是否忽略文件不存在404或者没有权限403错误
## 安装
1. 编译concat模块
configure [--with-http_concat_module | --with-http_concat_module=shared]
--with-http_concat_module选项concat模块将被静态编译到tengine中
--with-http_concat_module=shared,concat模块将被编译成动态文件采用动态模块的方式添加到tengine中
2. 编译,安装
make&make install
3. 配置concat的配置项
4. 运行

View file

@ -0,0 +1,64 @@
# Name #
**ngx\_http\_core\_module**
Tengine added some enhancements to this module. The new directives are listed below.
# Directives #
## client\_body\_buffers ##
Syntax: **client\_body\_buffers** `number size`
Default: 16 4k/8k
Context: `http, server, location`
Specify the number and size of buffers used when reading non buffered client request body, all the buffers are stored in the memory. Buffers are allocated only on demand. By default, the buffer size is equal to your OS's pagesize. The total buffer size should be larger than `client_body_postpone_size`, otherwise, it will be enlarged by force.
## client\_body\_postpone\_size ##
Syntax: **client\_body\_postpone\_size** `size`
Default: 64k
Context: `http, server, location`
When you turn off the `proxy_request_buffering` or `fastcgi_request_buffering`, Tengine will send the body to backend either it receives more than `size` data or the whole request body has been received. It can save the connection and reduce the network system call number with backend.
## proxy\_request\_buffering ##
Syntax: **proxy\_request\_buffering** `on | off`
Default: `on`
Context: `http, server, location`
Specify the request body will be buffered to the disk or not. If it's off, the request body will be stored in the memory and sent to backend after Tengine receives more than `client_body_postpone_size` data. It can avoid the disk IO with large request body.
By default in the buffered mode, the whole request body larger than the `client_body_buffer_size` will always be saved into the disk. This behavior may increase the server load greatly with heavy upload application.
Note that, if you turn it off, the nginx retry mechanism with unsuccessful response will be broken after you sent part of the request to backend. It just returns 500 directly when it encounters an unsuccessful response. This directive also breaks these variables: $request_body, $request_body_file. You should not use them any more while their values are incomplete.
Also note that, enabling spdy will prevent `proxy_request_buffering off` from taking effect.
## fastcgi\_request\_buffering ##
Syntax: **fastcgi\_request\_buffering** `on | off`
Default: `on`
Context: `http, server, location`
The same as `proxy_request_buffering`.
## gzip\_clear\_etag ##
Syntax: **gzip\_clear\_etag** `on | off`
Default: `on`
Context: `http, server, location`
Determines whether gzip module should clear the “ETag” response header field.

View file

@ -0,0 +1,65 @@
# 模块名 #
**ngx\_http\_core\_module**
Tengine针对此模块进行了增强下面列出了一些增加的指令。
# 指令 #
## client\_body\_buffers ##
Syntax: **client\_body\_buffers** `number size`
Default: 16 4k/8k
Context: `http, server, location`
当不缓存上传的请求body到磁盘时指定每块缓存块大小和数量。所有的缓存块都保存在内存中并且是按需分配的。默认情况下缓存块等于系统页的大小。总缓存大小必须大于`client_body_postpone_size`指令的大小。
## client\_body\_postpone\_size ##
Syntax: **client\_body\_postpone\_size** `size`
Default: 64k
Context: `http, server, location`
当打开`proxy_request_buffering`或`fastcgi_request_buffering`指令设置不缓存请求body到磁盘时tengine每当接受到大于`client_body_postpone_size`大小的数据或者整个请求都发送完毕才会往后端发送数据。这可以减少与后端服务器建立的连接数并减少网络IO的次数。
## proxy\_request\_buffering ##
Syntax: **proxy\_request\_buffering** `on | off`
Default: `on`
Context: `http, server, location`
指定当上传请求body时是否要将body缓存到磁盘。如果设成off请求body只会被保存到内存每当tengine接收到大于`client_body_postpone_size`的数据时,就发送这部分数据到后端服务器。
默认情况下当请求body大于`client_body_buffer_size`时就会被保存到磁盘。这会增加磁盘IO对于上传应用来说服务器的负载会明显增加。
需要注意的是如果你配置成off且已经发出部分数据tengine的重试机制就会失效。如果后端返回异常响应tengine就会直接返回500。此时$request_body$request_body_file也会不可用他们保存的可能是不完整的内容。
额外注意的是当tengine开启了spdy时`proxy_request_buffering off`不会起效。
## fastcgi\_request\_buffering ##
Syntax: **fastcgi\_request\_buffering** `on | off`
Default: `on`
Context: `http, server, location`
用法跟`proxy_request_buffering`指令一样。
## gzip\_clear\_etag ##
Syntax: **gzip\_clear\_etag** `on | off`
Default: `on`
Context: `http, server, location`
压缩的时候是否删除"ETag"响应头。

View file

@ -0,0 +1,250 @@
Name
====
* ngx_http_dyups_module
Description
===========
This module can be used to update your upstream-list without reloadding Nginx.
TODO:
It can not work with common `nginx_upstream_check_module`.
Compilation
===========
The module is not compiled into Tengine by default. It can be enabled with '--with-http_dyups_module'
configuration parameter, and enabled lua support with '--with-http_dyups_lua_api'.
But it can not be compiled as a '.so'.
Example
==========
file: conf/nginx.conf
daemon off;
error_log logs/error.log debug;
events {
}
http {
dyups_upstream_conf conf/upstream.conf;
include conf/upstream.conf;
server {
listen 8080;
location / {
proxy_pass http://$host;
}
}
server {
listen 8088;
location / {
echo 8088;
}
}
server {
listen 8089;
location / {
echo 8089;
}
}
server {
listen 8081;
location / {
dyups_interface;
}
}
}
file: conf/upstream.conf
upstream host1 {
server 127.0.0.1:8088;
}
upstream host2 {
server 127.0.0.1:8089;
}
Directives
===========
dyups_interface
--------------------------
**Syntax**: *dyups_interface*
**Default**: *none*
**Context**: *loc*
This directive set the interface location where you can add or delete the upstream list. See the section of Interface for detail.
dyups_read_msg_timeout
-----------------------------
**Syntax**: *dyups_read_msg_timeout time*
**Default**: *1s*
**Context**: *main*
This directive set the interval of workers readding the commands from share memory.
dyups_shm_zone_size
-----------------------------
**Syntax**: *dyups_shm_zone_size size*
**Default**: *2M*
**Context**: *main*
This directive set the size of share memory which used to store the commands.
dyups_upstream_conf
-----------------------------
**Syntax**: *dyups_upstream_conf path*
**Default**: *none*
**Context**: *main*
This directive set the path of file which you dumped all of upstreams' configs, it will be loaded in `init process` after process respwan to restore upstreams.
dyups_trylock
-----------------------------
**Syntax**: *dyups_trylock on | off*
**Default**: *off*
**Context**: *main*
You will get a better prefomance but it maybe not stable, and you will get a '409' when the update request conflicts with others.
restful interface
========================
GET
-------------------
* `/detail` get all upstreams and their servers
* `/list` get the list of upstreams
* `/upstream/name` find the upstream by it's name
POST
-------------------
* `/upstream/name` update one upstream
* `body` commands;
* `body` server ip:port;
DELETE
-------------------
* `/upstream/name` delete one upstream
Call the interface, when you get the return code is `HTTP_INTERNAL_SERVER_ERROR 500`, you need to reload nginx to make the Nginx work at a good state.
If you got `HTTP_CONFLICT 409`, you need resend the same commands again latter.
The /list and /detail interface will return `HTTP_NO_CONTENT 204` when there is no upstream.
Other code means you should modify your commands and call the interface again.
`ATTENEION`: You also need a `third-party` to generate the new config and dump it to Nginx'conf directory.
Sample
-------------------
```bash
» curl -H "host: dyhost" 127.0.0.1:8080
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.3.13</center>
</body>
</html>
» curl -d "server 127.0.0.1:8089;server 127.0.0.1:8088;" 127.0.0.1:8081/upstream/dyhost
success
» curl -H "host: dyhost" 127.0.0.1:8080
8089
» curl -H "host: dyhost" 127.0.0.1:8080
8088
» curl 127.0.0.1:8081/detail
host1
server 127.0.0.1:8088
host2
server 127.0.0.1:8089
dyhost
server 127.0.0.1:8089
server 127.0.0.1:8088
» curl -i -X DELETE 127.0.0.1:8081/upstream/dyhost
success
» curl 127.0.0.1:8081/detail
host1
server 127.0.0.1:8088
host2
server 127.0.0.1:8089
```
API
========================
```c
extern ngx_flag_t ngx_http_dyups_api_enable;
ngx_int_t ngx_dyups_update_upstream(ngx_str_t *name, ngx_buf_t *buf,
ngx_str_t *rv);
ngx_int_t ngx_dyups_delete_upstream(ngx_str_t *name, ngx_str_t *rv);
```
## Lua API Example
NOTICE:
you should add the directive `dyups_interface` into your config file to active this feature
```lua
content_by_lua '
local dyups = require "ngx.dyups"
local status, rv = dyups.update("test", [[server 127.0.0.1:8088;]]);
ngx.print(status, rv)
if status ~= 200 then
ngx.print(status, rv)
return
end
ngx.print("update success")
status, rv = dyups.delete("test")
if status ~= 200 then
ngx.print(status, rv)
return
end
ngx.print("delete success")
';
```

View file

@ -0,0 +1,89 @@
Name
====
* limit_req module
Description
===========
* This is the enhanced version of nginx's limit_req module with white list support, and more limit conditions are allowed in a single location.
Directives
==========
limit_req_zone
-------------
**Syntax**: *limit_req_zone $session_variable1 $session_variable2 ... zone=name_of_zone:size rate=rate*
**Default**: *none*
**Context**: *http*
Support more than one limit variables. For example:
limit_req_zone $binary_remote_addr $uri zone=one:3m rate=1r/s;
limit_req_zone $binary_remote_addr $request_uri zone=two:3m rate=1r/s;
The last line of the above example indicates a client can access a specific URI only once in a second.
limit_req
------------------------
**Syntax**: *limit_req [off] | zone=zone_name [burst=burst] \[forbid_action=action\] \[nodelay\]*
**Default**: *none*
**Context**: *http, server, location*
Multiple limit conditions are allowed in a single block. And all the conditions are examined in order.
You can turn this directive on or off (default is on).
'forbid_action' specifies the action URL to redirect. It can be a named location. By default, tengine will return 503.
For example:
limit_req_zone $binary_remote_addr zone=one:3m rate=1r/s;
limit_req_zone $binary_remote_addr $uri zone=two:3m rate=1r/s;
limit_req_zone $binary_remote_addr $request_uri zone=three:3m rate=1r/s;
location / {
limit_req zone=one burst=5;
limit_req zone=two forbid_action=@test1;
limit_req zone=three burst=3 forbid_action=@test2;
}
location /off {
limit_req off;
}
location @test1 {
rewrite ^ /test1.html;
}
location @test2 {
rewrite ^ /test2.html;
}
limit_req_whitelist
------------------------
**Syntax**: *limit_req_whitelist geo_var_name=var_name geo_var_value=var_value*
**Default**: *none*
**Context**: *http, server, location*
Set the whitelist.
This directive needs work with the geo module. The 'geo_var_name' is the variable name declared in the geo module, 'geo_var_value' is its value. For example:
geo $white_ip {
ranges;
default 0;
127.0.0.1-127.0.0.255 1;
}
limit_req_whitelist geo_var_name=white_ip geo_var_value=1;
It means requests from IP (127.0.0.1 to 127.0.0.255) will be considered safe and let pass.

View file

@ -0,0 +1,174 @@
Name
====
* ngx_http_reqstat_module
Description
===========
This module will help monitor running status of Tengine.
* It can provide running status information of Tengine.
* The information is divided into different zones, and each zone is independent.
* The status information is about connections, requests, response status codes, input and output flows,
rt, upstreams, and so on.
* It shows all the results by default, and can be set to show part of them by specifying zones.
* It support for user-defined status by using nginx variables. The maximum of all the status is 50.
* It recycles out-of-date running status information.
Compilation
===========
The module is compiled into Tengine by default. It can be disabled with '--without-http_reqstat_module'
configuration parameter, or it can be compiled as a '.so' with '--with-http_reqstat_module=shared'.
Example
===========
http {
req_status_zone server "$host,$server_addr:$server_port" 10M;
server {
location /us {
req_status_show;
}
req_status server;
}
}
* when you call '/us', you will get the results like this:
www.taobao.com,127.0.0.1:80,162,6242,1,1,1,0,0,0,0,10,1,10,1
* Each line shows the status infomation of a "$host,$server_addr:$server_port".
* Line format:
kv,bytes_in_total,bytes_out_total,conn_total,req_total,2xx,3xx,4xx,5xx,other,rt_total,upstream_req,upstream_rt,upstream_tries,200,206,302,304,403,404,416,499,500,502,503,504,508,detail_other,ups_4xx,ups_5xx
* **kv** value of the variable defined by the directive 'req_status_zone'. The maximun key length is configurable, 104B by default, and overlength will be cut off
* **bytes_in_total** total number of bytes received from client
* **bytes_out_total** total number of bytes sent to client
* **conn_total** total number of accepted connections
* **req_total** total number of processed requests
* **2xx** total number of 2xx requests
* **3xx** total number of 3xx requests
* **4xx** total number of 4xx requests
* **5xx** total number of 5xx requests
* **other** total number of other requests
* **rt_total** accumulation or rt
* **upstream_req** total number of requests calling for upstream
* **upstream_rt** accumulation or upstream rt
* **upstream_tries** total number of times calling for upstream
* **200** total number of 200 requests
* **206** total number of 206 requests
* **302** total number of 302 requests
* **304** total number of 304 requests
* **403** total number of 403 requests
* **404** total number of 404 requests
* **416** total number of 416 requests
* **499** total number of 499 requests
* **500** total number of 500 requests
* **502** total number of 502 requests
* **503** total number of 503 requests
* **504** total number of 504 requests
* **508** total number of 508 requests
* **detail_other** total number of requests of other status codes
* **ups_4xx** total number of requests of upstream 4xx
* **ups_5xx** total number of requests of upstream 5xx
* some fields will be removed in future, because user-defined status has been supported.
* tsar can parse the result and monitor, see also https://github.com/alibaba/tsar
Directives
==========
req_status_zone
-------------------------
**Syntax**: *req_status_zone zone_name value size*
**Default**: *none*
**Context**: *main*
create shared memory for this module. 'zone_name' is the name of memory block.
'value' defines the key, in which variables can be used.
'size' defines the size of shared memory.
Example:
req_status_zone server "$host,$server_addr:$server_port" 10M;
the memory is 10MB, the key is "$host,$server_addr:$server_port", and the name is "server".
* Notice, if you want to use tsar to monitor, you should not use comma in the key.
req_status
-------------------------
**Syntax**: *req_status zone_name1 [zone_name2 [zone_name3]]*
**Default**: *none*
**Context**: *main、srv、loc*
Enable monitoring. You can specify multiple zones to monitor.
req_status_show
-------------------------
**Syntax**: *req_status_show [zone_name1 [zone_name2 [...]]]*
**Default**: *all the targets defined by 'req_status_zone'*
**Context**: *loc*
Display the status information. You can specify zones to display.
req_status_zone_add_indicator
--------------------------------
**Syntax**: *req_status_zone_add_indecator zone_name $var1 [$var2 [...]]*
**Default**: *none*
**Context**: *main*
Add user-defined status by using nginx variables. The status will be appended at the end of each line on display.
req_status_zone_key_length
-------------------------------
**Syntax**: *req_status_zone_key_length zone_name length*
**Default**: *none*
**Context**: *main*
Define the maximun length of key for a zone. The default is 104.
req_status_zone_recycle
-------------------------------
**Syntax**: *req_status_zone_recycle zone_name times seconds*
**Default**: *none*
**Context**: *main*
Define the recycle threshold for a zone. Recycle will be switched on when the shared memory is exhausted, and will only take effect on imformation whose visit frequency is lower than the setting.
The setting frequency is defined by 'times' and 'seconds', and it is 10r/min by default.
req_status_zone_recycle demo_zone 10 60;

View file

@ -0,0 +1,165 @@
模块名
====
* ngx_http_reqstat_module监控模块
描述
===========
* 这个模块计算定义的变量根据变量值分别统计Tengine的运行状况。
* 可以监视的运行状况有连接数、请求数、各种响应码范围的请求数、输入输出流量、rt、upstream访问等。
* 可以指定获取所有监控结果或者一部分监控结果。
* 利用变量添加自定义监控状态。总的监控状态最大个数为50个。
* 回收过期的监控数据。
编译
===========
默认编入Tengine可通过--without-http_reqstat_module不编译此模块或通过--with-http_reqstat_module=shared编译为so模块。
例子
===========
http {
req_status_zone server "$host,$server_addr:$server_port" 10M;
server {
location /us {
req_status_show;
}
req_status server;
}
}
* 以上例,通过访问/us得到统计结果
* 每行对应一个server
* 每行的格式
kv,bytes_in_total,bytes_out_total,conn_total,req_total,2xx,3xx,4xx,5xx,other,rt_total,upstream_req,upstream_rt,upstream_tries,200,206,302,304,403,404,416,499,500,502,503,504,508,detail_other,ups_4xx,ups_5xx
* kv 计算得到的req_status_zone指令定义变量的值最大长度可配置默认104B超长的部分截断
* bytes_in_total 从客户端接收流量总和
* bytes_out_total 发送到客户端流量总和
* conn_total 处理过的连接总数
* req_total 处理过的总请求数
* 2xx 2xx请求的总数
* 3xx 3xx请求的总数
* 4xx 4xx请求的总数
* 5xx 5xx请求的总数
* other 其他请求的总数
* rt_total rt的总数
* upstream_req 需要访问upstream的请求总数
* upstream_rt 访问upstream的总rt
* upstream_tries upstram总访问次数
* 200 200请求的总数
* 206 206请求的总数
* 302 302请求的总数
* 304 304请求的总数
* 403 403请求的总数
* 404 404请求的总数
* 416 416请求的总数
* 499 499请求的总数
* 500 500请求的总数
* 502 502请求的总数
* 503 503请求的总数
* 504 504请求的总数
* 508 508请求的总数
* detail_other 非以上13种status code的请求总数
* ups_4xx upstream返回4xx响应的请求总数
* ups_5xx upstream返回5xx响应的请求总数
* 注,后续会清理这些状态,因为已经支持了自定义状态。
* tsar可解析输出结果具体见https://github.com/alibaba/tsar
指令
==========
req_status_zone
-------------------------
**Syntax**: *req_status_zone zone_name value size*
**Default**: *none*
**Context**: *main*
创建统计使用的共享内存。zone_name是共享内存的名称value用于定义key支持变量。size是共享内存的大小。
例子:
req_status_zone server "$host,$server_addr:$server_port" 10M;
创建名为“server”的共享内存大小10M使用“$host,$server_addr:$server_port”计算key。
* 注意如果希望用tsar来监控的话key的定义中请不要使用逗号。
req_status
-------------------------
**Syntax**: *req_status zone_name1 [zone_name2 [zone_name3]]*
**Default**: *none*
**Context**: *main、srv、loc*
开启统计可以指定同时统计多个目标每一个zone_name对应一个目标。
req_status_show
-------------------------
**Syntax**: *req_status_show [zone_name1 [zone_name2 [...]]]*
**Default**: *所有建立的共享内存目标*
**Context**: *loc*
按格式返回统计结果。可指定返回部分目标的统计结果。
req_status_zone_add_indicator
--------------------------------
**Syntax**: *req_status_zone_add_indecator zone_name $var1 [$var2 [...]]*
**Default**: *none*
**Context**: *main*
通过变量增加自定义字段,新增加的字段目前会展现在每行的末尾。
req_status_zone_key_length
-------------------------------
**Syntax**: *req_status_zone_key_length zone_name length*
**Default**: *none*
**Context**: *main*
定义某个共享内存块中key的最大长度默认值104。key中超出的部分会被截断。
req_status_zone_recycle
-------------------------------
**Syntax**: *req_status_zone_recycle zone_name times seconds*
**Default**: *none*
**Context**: *main*
定义某个共享内存块过期数据的回收。回收在共享内存耗尽时自动开启。只会回收访问频率低于设置值的监控数据。
频率定义为 times / seconds默认值为10r/min
req_status_zone_recycle demo_zone 10 60;

View file

@ -0,0 +1,67 @@
# Name #
**NOTE**
1. This module has been updated to official nginx SPDY/3.1 module, the document is available here:
http://nginx.org/en/docs/http/ngx_http_spdy_module.html
2. This document only applies to Tengine-2.1.0 and its old version. But the listen option `spdy_detect` can still be used with SPDY/3.1.
**ngx\_http\_spdy\_module**
Tengine added SPDY/3 support to this module. The new directives are listed below.
# Directives #
## spdy\_version ##
Syntax: **spdy\_version** [2|3]
Default: 3
Context: http, server
Specify the version of current SPDY protocol.
## spdy\_flow\_control ##
Syntax: **spdy\_flow\_control** on|off
Default: on
Context: http, server
Turn on or off with SPDY flow control.
## spdy\_init\_recv\_window\_size ##
Syntax: **spdy\_init\_recv\_window\_size** size
Default: 64k
Context: http, server
Specify the receiving window size for SPDY. By default, it's 64K. It will send a WINDOW UPDATE frame when it receives half of the window size data every time.
## spdy\_detect ##
Syntax: listen address[:port] [spdy_detect] [ssl]
Default:
Context: listen directive
Server can work for SPDY and HTTP on the same port with this directive. Note that the server will examine the first byte of one connection and determine whether the connection is SPDY or HTTP based on what it looks like (0x80 or 0x00 for SPDY).
Server will listen on port 80 for SPDY and HTTP, for example:
listen 80 spdy_detect;
Server will detect whether SPDY or HTTP is used without using a TLS extension (NPN), for example:
listen 443 ssl spdy_detect;
Server can detect whether SPDY or HTTP is used directly, and also it can negotiate with client via NPN, for example:
listen 443 ssl spdy_detect spdy;

View file

@ -0,0 +1,67 @@
# Name #
**注意**
1. Tengine-2.1.0以上版本的SPDY模块已经与官方nginx同步只支持SPDY/3.1。
文档参考: http://nginx.org/en/docs/http/ngx_http_SPDY_module.html
2. 以下文档只适用于Tengine-2.1.0及以下版本只支持SPDY/2和SPDY/3。listen参数`spdy_detect`在SPDY/3.1下任然可以使用。
**ngx\_http\_spdy\_module**
Tengine对SPDY模块增加SPDY/3协议的支持。以下是新增的指令。
# Directives #
## spdy\_version ##
Syntax: **spdy\_version** [2|3]
Default: 3
Context: http, server
指定SPDY协议使用的版本。默认是SPDY/3。
## spdy\_flow\_control ##
Syntax: **spdy\_flow\_control** on|off
Default: on
Context: http, server
打开或关闭SPDY/3的流控功能。
## spdy\_init\_recv\_window\_size ##
Syntax: **spdy\_init\_recv\_window\_size** size
Default: 64k
Context: http, server
指定SPDY/3服务器的接收窗口大小。接收窗口大小默认值是64K。服务器每次会在接收窗口使用超过一半时给客户端发送窗口更新帧(WINDOW UPDATE frame)。
## spdy\_detect ##
Syntax: listen address[:port] [spdy_detect] [ssl]
Default:
Context: listen directive
启用这个指令时SPDY协议和HTTP协议可以工作在同一个端口上。注意服务器通过探测每个TCP连接上的首字节来判断此连接上是SPDY协议还是HTTP协议(如果首字节是0x80或者0x00则认为是SPDY协议)。
服务器在80端口上同时监听SPDY连接和HTTP连接配置如下
listen 80 spdy_detect;
服务器在443端口上自动探测SSL层下是SPDY协议还是HTTP协议。注意服务器不会通过TLS扩展(NPN)来协商是SPDY协议还是HTTP协议配置如下
listen 443 ssl spdy_detect;
服务器在443端口上既可以自动探测SSL层下是SPDY协议还是HTTP协议也可以通过TLS扩展(NPN)来协商是SPDY协议还是HTTP协议配置如下
listen 443 ssl spdy_detect spdy;

View file

@ -0,0 +1,127 @@
# ngx_http_sysguard_module
## Description
This module monitors memory usage (including the swap partition), load of CPUs and average response time of requests of the system. If any guideline that is monitored exceeds the threshold set by user, the current request will be redirected to a specific url. To be clarified, this module can only be full functional when the system supports sysinfo function and loadavg function. The sysguard module also need to read memory information from /proc file system.
## Configuration
server {
sysguard on;
sysguard_mode or;
sysguard_load load=10.5 action=/loadlimit;
sysguard_mem swapratio=20% action=/swaplimit;
sysguard_mem free=100M action=/freelimit;
sysguard_rt rt=0.01 period=5s action=/rtlimit;
location /loadlimit {
return 503;
}
location /swaplimit {
return 503;
}
location /freelimit {
return 503;
}
location /rtlimit {
return 503;
}
}
## Directives
**sysguard** `on` | `off`
**Default:** `sysguard off`
**Context:** `http, server, location`
Enable or disable the sysguard module.
<br/>
<br/>
**sysguard_load** `load=[ncpu*]number [action=/url]`
**Default:** `none`
**Context:** `http, server, location`
This directive tells the module to protect the system by monitoring the load of CPUs. If the system's loads reach the value that is specified by 'number' in one minute, the incoming request will be redirected to the url specified by 'action' parameter. If 'action' is not specified, tengine will respond with 503 error directly. It's also possible to use ncpu\* to make the configuration, in which case, ncpu stands for the number of the CPU cores. For instance, load = ncpu*1.5.
<br/>
<br/>
**sysguard_mem** `[swapratio=ratio%] [free=size] [action=/url]`
**Default:** `-`
**Context:** `http, server, location`
This directive is used to tell the module to protect the system by monitoring memroy usage. 'swapratio' is used to specify how many percent of the swap partition of the system, and 'free' is used to specify the miminum size of current memory. If any condition is fulfilled, the incoming request will be redirected to specified url, which is defined by parameter 'action'. If 'action' is not specified, the request will be responded with 503 error directly. Besides, if the user disables the swap partition in the system, this directive will not be functional. 'free' is calculated by /proc/meminfo, the algorithm is 'memfree = free + buffered + cached'.
<br/>
<br/>
**sysguard_rt** `[rt=seconds] [period=time] [action=/url]`
**Default:** `-`
**Context:** `http, server, location`
This directive is used to tell the module to protect the system by monitoring average response time of requests in a specified period. Parameter rt is used to set a threshold of the average response time, in second. Parameter period is used to specifiy the period of the statistics cycle. If the average response time of the system exceeds the threshold specified by the user, the incoming request will be redirected to a specified url which is defined by parameter 'action'. If no 'action' is presented, the request will be responded with 503 error directly.
<br/>
<br/>
**sysguard_mode** `and` | `or`
**Default:** 'sysguard_mode or'
**Context** 'http, server, location'
If there are more than one type of monitor, this directive is used to specified the relations among all the monitors which are: 'and' for all matching and 'or' for any matching.
<br/>
<br/>
**sysguard_interval** 'time'
**Default** 'sysguard_interval 1s'
**Context** 'http, server, location'
Specify the time interval to update your system information.
<br/>
<br/>
**sysguard_log_level** '[info | notice | warn | error]'
**Default** 'sysguard_log_level error'
**Context** 'http, server, location'
Specify the log level of sysguard.
## Installation
1. Compile sysguard module
configure [--with-http_sysguard_module | --with-http_sysguard_module=shared]
--with-http_sysguard_module, sysguard module will be compiled statically into tengine.
--with-http_sysguard_module=shared, sysguard module will be compiled dynamically into tengine.
2. Build and install
make&make install
3. Make sysguard configuration
4. Run

View file

@ -0,0 +1,127 @@
# sysguard 模块
## 介绍
该模块监控内存含swap分区、CPU和请求的响应时间当某些监控指标达到设定的阈值时跳转到指定的url。注意目前该模块仅对系统支持sysinfo函数时才支持基于load与内存信息的保护以及系统支持loadavg函数时支持基于load进行保护。模块需要从/proc文件系统中读取内存信息。
## 配置
server {
sysguard on;
sysguard_mode or;
sysguard_load load=10.5 action=/loadlimit;
sysguard_mem swapratio=20% action=/swaplimit;
sysguard_mem free=100M action=/freelimit;
sysguard_rt rt=0.01 period=5s action=/rtlimit;
location /loadlimit {
return 503;
}
location /swaplimit {
return 503;
}
location /freelimit {
return 503;
}
location /rtlimit {
return 503;
}
}
## 指令
**sysguard** `on` | `off`
**默认:** `sysguard off`
**上下文:** `http, server, location`
打开或者关闭这个模块
<br/>
<br/>
**sysguard_load** `load=[ncpu*]number [action=/url]`
**默认:** `none`
**上下文:** `http, server, location`
该指令用于配置根据系统的load来限制用户的请求以保护系统。当系统在一分钟内的load达到number时将进来的请求转到action所指定的url。如果action没有配置则直接返回503错误。load的数值还支持使用ncpu\*系数的方式来配置ncpu表示cpu核数乘以固定的系数得出期望限制的load值如: load=ncpu\*1.5。
<br/>
<br/>
**sysguard_mem** `[swapratio=ratio%] [free=size] [action=/url]`
**默认:** `-`
**上下文:** `http, server, location`
该指令用于配置根据系统的内存使用状态来限制用户请求以保护系统。swapratio用于配置当当前交换空间的已使用ratio%时或者剩下的内存少于size时就将进来的请求跳转到指定的url。如果action没有配置则直接返回503错误。另外如果用户自己禁用了交换区间则配置该指定是不起作用的。free是根据/proc/meminfo的内容来计算的计算公式是"memfree= free + buffered + cached"
<br/>
<br/>
**sysguard_rt** `[rt=seconds] [period=time] [action=/url]`
**默认:** `-`
**上下文:** `http, server, location`
该指令用于配置根据系统的请求平均响应时间来限制用户请求以保护系统。rt参数用于设置请求的平均响应时间的阈值单位为秒平均响应时间的统计周期使用period参数设置。当系统的请求平均响应时间大于阈值时将当前请求跳转到action参数配置的url如果action没有配置则直接返回503。
<br/>
<br/>
**sysguard_mode** `and` | `or`
**默认:** 'sysguard_mode or'
**上下文** 'http, server, location'
如果设置了多个监控指标此参数用于指定指标间的判断关系and为全部满足or为任一满足。
<br/>
<br/>
**sysguard_interval** 'time'
**默认** 'sysguard_interval 1s'
**上下文** 'http, server, location'
该指定用于配置获取系统信息时的缓存时间。默认为1s则表示在这1s内只调用一次系统函数来获取系统的当前状况。
<br/>
<br/>
**sysguard_log_level** '[info | notice | warn | error]'
**默认** 'sysguard_log_level error'
**上下文** 'http, server, location'
该指令用于配置,当保护系统的操作执行时,记录日志时的日志级别。
## 安装
1. 编译sysguard模块
configure [--with-http_sysguard_module | --with-http_sysguard_module=shared]
--with-http_sysguard_module选项sysguard模块将被静态编译到tengine中
--with-http_sysguard_module=shared, sysguard模块将被编译成动态文件采用动态模块的方式添加到tengine中
2. 编译,安装
make&make install
3. 配置sysguard的配置项
4. 运行

View file

@ -0,0 +1,272 @@
Name
====
* TFS module
Description
===========
* This module implements an asynchronous client of TFS(Taobao File System), providing RESTful API to it. [TFS](http://tfs.taobao.org) is a distributed file system developed by Taobao Inc.
This module is not built by default, it should be enabled with the `--with-http_tfs_module` configuration parameter.
Example
=======
http {
#tfs_upstream tfs_rc {
# server 127.0.0.1:6100;
# type rcs;
# rcs_zone name=tfs1 size=128M;
# rcs_interface eth0;
# rcs_heartbeat lock_file=/logs/lk.file interval=10s;
#}
tfs_upstream tfs_ns {
server 127.0.0.1:8108;
type ns;
}
server {
listen 7500;
server_name localhost;
tfs_keepalive max_cached=100 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /path/to/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
location / {
tfs_pass tfs://tfs_ns;
}
}
}
Directives
==========
tfs\_upstream
----------------
**Syntax** *tfs\_upstream name {...}*
**Default** *none*
**Context** *http*
Defines information of upstream TFS server.
Example:
tfs_upstream tfs_rc {
server 127.0.0.1:6100;
type rcs;
rcs_zone name=tfs1 size=128M;
rcs_interface eth0;
rcs_heartbeat lock_file=/logs/lk.file interval=10s;
}
tfs_upstream tfs_ns {
server 127.0.0.1:8100;
type ns;
}
server
------------
**Syntax** *server address*
**Default** *none*
**Context** *tfs_upstream*
Defines the address of upstream TFS server. An address can be specified as a domain name or IP address.
Example :
server 10.0.0.1:8108;
type
----------------
**Syntax** *type [ns | rcs]*
**Default** *ns*
**Context** *tfs_upstream*
Specify the type of upstream TFS server. It could be ns(NameServer) or rcs(RcServer), default is ns.
rcs\_zone
--------------
**Syntax** *rcs_zone name=n size=num*
**Default** *none*
**Context** *tfs_upstream*
Defines the shared memory zone used to store application configuration information registerd in RcServer. This directive is mandatory when upstream is RcServer. Application configuration information can be updated through heartbeat with RcServer(directive <i>rcs_heartbeat</i>).
Example:
rcs_zone name=tfs1 size=128M;
rcs\_heartbeat
--------------
**Syntax** *rcs_heartbeat lock_file=/path/to/file interval=time*
**Default** *none*
**Context** *tfs_upstream*
Enable heartbeat with RcServer so that application configuration information can be updated in time. It is mandatory when upstream is RcServer.
The following parameters must be defined:
lock_file=<i>/path/to/file</i>
use to create a mutex so that only one Nginx worker can do heartbeat at one time.
interval=<i>time</i>
set heartbeat interval.
Example:
rcs_heartbeat lock_file=/path/to/nginx/logs/lk.file interval=10s;
rcs\_interface
----------------
**Syntax** *rcs\_interface interface*
**Default** *none*
**Context** *tfs_upstream*
Specify net interface used by TFS module. It is used to get local IP address. It is only mandatory when upstream is RCServer.
Example:
rcs_interface eth0;
tfs_pass
--------
**Syntax** *tfs_pass name*
**Default** *none*
**Context** *location*
Specify TFS upstream. Remember that protocol used here must be "tfs".
Example:
tfs_upstream tfs_rc {
};
location / {
tfs_pass tfs://tfs_rc;
}
tfs_keepalive
-------------
**Syntax** *tfs_keepalive max_cached=num bucket_count=num*
**Default** *none*
**Context** *http, server*
Defines connection pool used by TFS module. This connection pool caches upstream connections.
The following parameters must be defined:
max_cached=<i>num</i>
set the capacity of one hash bucket.
bucket_count=<i>num</i>
set the count of hash buckets.
Example:
tfs_keepalive max_cached=100 bucket_count=15;
tfs\_block\_cache\_zone
-----------------------
**Syntax** *tfs_block_cache_zone size=num*
**Default** *none*
**Context** *http*
Defines the shared memory zone used for BlockCache.
Example:
tfs_block_cache_zone size=256M;
tfs\_log
----------------
**Syntax** *tfs_log path*
**Default** *none*
**Context** *http, server*
Sets the TFS access log.
Example:
tfs_log "pipe:/usr/sbin/cronolog -p 30min /path/to/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
tfs\_body\_buffer\_size
-----------------------
**Syntax** *tfs_body_buffer_size size*
**Default** *2m*
**Context** *http, server, location*
Sets the buffer size for reading upstream response. By default, buffer size is 2m.
Example:
tfs_body_buffer_size 2m;
tfs\_connect\_timeout
---------------------
**Syntax** *tfs_connect_timeout time*
**Default** *3s*
**Context** *http, server, location*
Sets a timeout for connecting upstream servers.
tfs\_send\_timeout
------------------
**Syntax** *tfs_send_timeout time*
**Default** *3s*
**Context** *http, server, location*
Sets a timeout for transmitting data to upstream servers.
tfs\_read\_timeout
------------------
**Syntax** *tfs_read_timeout time*
**Default** *3s*
**Context** *http, server, location*
Sets a timeout for reading data from upstream servers.
Others
------
Uploading file size supported depends on the directive <i>client_max_body_size</i>.

View file

@ -0,0 +1,246 @@
模块名
====
* nginx-tfs
描述
====
* 这个模块实现了TFS的客户端为TFS提供了RESTful API。TFS的全称是Taobao File System是淘宝开源的一个分布式文件系统。
编译安装
=======
1. TFS模块使用了一个开源的JSON库来支持JSON请先安装[yajl](http://lloyd.github.com/yajl/)-2.0.1。
2. 下载[nginx](http://www.nginx.org/)或[tengine](http://tengine.taobao.org/)。
3. ./configure --add-module=/path/to/nginx-tfs
4. make && make install
配置
====
http {
#tfs_upstream tfs_rc {
# server 127.0.0.1:6100;
# type rcs;
# rcs_zone name=tfs1 size=128M;
# rcs_interface eth0;
# rcs_heartbeat lock_file=/logs/lk.file interval=10s;
#}
tfs_upstream tfs_ns {
server 127.0.0.1:6100;
type ns;
}
server {
listen 7500;
server_name localhost;
tfs_keepalive max_cached=100 bucket_count=10;
tfs_log "pipe:/usr/sbin/cronolog -p 30min /path/to/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
location / {
tfs_pass tfs://tfs_ns;
}
}
}
指令
====
server
------------
**Syntax** *server address*
**Default** *none*
**Context** *tfs_upstream*
指定后端TFS服务器的地址当指令<i>type</i><i>rcs</i>时为RcServer的地址如果为为<i>ns</i>时为NameServer的地址。此指令必须配置。例如:
server 10.0.0.1:8108;
type
----------------
**Syntax** *type [ns | rcs]*
**Default** *ns*
**Context** *tfs_upstream*
设置server类型类型只能为ns或者rcs如果为ns,则指令<i>server</i>指定的地址为NameServer的地址如果为rcs,则为RcServer的地址。如需使用自定义文件名功能请设置类型为rcs使用自定义文件名功能需额外配置MetaServer和RootServer。
rcs\_zone
--------------
**Syntax** *rcs_zone name=n size=num*
**Default** *none*
**Context** *tfs_upstream*
配置TFS应用在RcServer的配置信息。若开启RcServer配置了<i>type rcs</i>则必须配置此指令。配置此指令会在共享内存中缓存TFS应用在RcServer的配置信息并可以通过指令<i>rcs_heartbeat</i>来和RcServer进行keepalive以保证应用的配置信息的及时更新。例如
rcs_zone name=tfs1 size=128M;
rcs\_heartbeat
--------------
**Syntax** *rcs_heartbeat lock_file=/path/to/file interval=time*
**Default** *none*
**Context** *tfs_upstream*
配置TFS应用和RcServer的keepalive应用可通过此功能来和RcServer定期交互以及时更新其配置信息。若开启RcServer功能配置了<i>type rcs</i>),则必须配置此指令。例如:
rcs_heartbeat lock_file=/path/to/nginx/logs/lk.file interval=10s;
rcs\_interface
----------------
**Syntax** *rcs\_interface interface*
**Default** *none*
**Context** *tfs_upstream*
配置TFS模块使用的网卡。若开启RcServer功能配置了<i>type rcs</i>),则必须配置此指令。例如:
rcs_interface eth0;
tfs\_upstream
----------------
**Syntax** *tfs\_upstream name {...}*
**Default** *none*
**Context** *http*
配置TFS模块的server信息,这个块包括上面几个命令。例如:
tfs_upstream tfs_rc {
server 127.0.0.1:6100;
type rcs;
rcs_zone name=tfs1 size=128M;
rcs_interface eth0;
rcs_heartbeat lock_file=/logs/lk.file interval=10s;
}
tfs_pass
--------
**Syntax** *tfs_pass name*
**Default** *none*
**Context** *location*
是否打开TFS模块功能此指令为关键指令决定请求是否由TFS模块处理必须配置。需要注意这里不支持直接写ip地址或者域名这里只支持指令<i>tfs_upstream name {...} </i>配置的upstream,并且必须以 tfs:// 开头。例如:
tfs_upstream tfs_rc {
};
location / {
tfs_pass tfs://tfs_rc;
}
tfs_keepalive
-------------
**Syntax** *tfs_keepalive max_cached=num bucket_count=num*
**Default** *none*
**Context** *http, server*
配置TFS模块使用的连接池的大小TFS模块的连接池会缓存TFS模块和后端TFS服务器的连接。可以把这个连接池看作由多个hash桶构成的hash表其中bucket\_count是桶的个数max\_cached是桶的容量。此指令必须配置。注意应该根据机器的内存情况来合理配置连接池的大小。例如
tfs_keepalive max_cached=100 bucket_count=15;
tfs\_block\_cache\_zone
-----------------------
**Syntax** *tfs_block_cache_zone size=num*
**Default** *none*
**Context** *http*
配置TFS模块的本地BlockCache。配置此指令会在共享内存中缓存TFS中的Block和DataServer的映射关系。注意应根据机器的内存情况来合理配置BlockCache大小。例如
tfs_block_cache_zone size=256M;
tfs\_log
----------------
**Syntax** *tfs_log path*
**Default** *none*
**Context** *http, server*
是否进行TFS访问记录。配置此指令会以固定格式将访问TFS的请求记录到指定log中以便进行分析。具体格式参见代码。例如
tfs_log "pipe:/usr/sbin/cronolog -p 30min /path/to/nginx/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";
cronolog支持依赖于tengine提供的扩展的日志模块。
tfs\_body\_buffer\_size
-----------------------
**Syntax** *tfs_body_buffer_size size*
**Default** *2m*
**Context** *http, server, location*
配置用于和后端TFS服务器交互时使用的的body_buffer的大小。默认为2m。例如
tfs_body_buffer_size 2m;
tfs\_connect\_timeout
---------------------
**Syntax** *tfs_connect_timeout time*
**Default** *3s*
**Context** *http, server, location*
配置连接后端TFS服务器的超时时间。
tfs\_send\_timeout
------------------
**Syntax** *tfs_send_timeout time*
**Default** *3s*
**Context** *http, server, location*
配置向后端TFS服务器发送数据的超时时间。
tfs\_read\_timeout
------------------
**Syntax** *tfs_read_timeout time*
**Default** *3s*
**Context** *http, server, location*
配置从后端TFS服务器接收数据的超时时间。
其他
----
能支持上传文件大小决定于<i>client_max_body_size</i>指令配置的大小。

View file

@ -0,0 +1,168 @@
# Ngx_http_trim_filter module
The ngx_http_trim_filter module is a filter that modifies a response by removing unnecessary whitespaces
(spaces, tabs, newlines) and comments from HTML (including inline javascript and css). Trim module parses
HTML with a state machine.
## Example Configuration
location / {
trim on;
trim_js on;
trim_css on;
}
## Directives
**trim** `on` | `off`
**Default:** `trim off`
**Context:** `http, server, location`
Enable or disable trim module for pure HTML.
This module will retain some contents unchanged, in case that they are enclosed by the tag `pre`,`textarea`,`script` and `style`,as well as IE/SSI/ESI comments.
Parameter value can contain variables.
Example:
set $flag "off";
if ($condition) {
set $flag "on";
}
trim $flag;
<br/>
**trim_js** `on` | `off`
**Default:** `trim_js off`
**Context:** `http, server, location`
Enable or disable trim module for inline javascript.
Parameter value can contain variables too.
<br/>
**trim_css** `on` | `off`
**Default:** `trim_css off`
**Context:** `http, server, location`
Enable or disable trim module for inline css.
Parameter value can contain variables too.
<br/>
**trim_types** `MIME types`
**Default:** `trim_types: text/html`
**Context:** `http, server, location`
Enable trim module for the specified MIME types in addition to "text/html". Responses with the “text/html” type are always processed.
<br/>
## Debug
Trim module will be disabled if incoming request has `http_trim=off` parameter in url.
e.g. `http://www.xxx.com/index.html?http_trim=off`
## Sample
original:
<!DOCTYPE html>
<textarea >
trim
module
</textarea >
<!--remove all-->
<!--[if IE]> trim module <![endif]-->
<!--[if !IE ]>--> trim module <!--<![endif]-->
<!--# ssi-->
<!--esi-->
<pre style =
"color: blue" >Welcome to nginx!</pre >
<script type="text/javascript">
/*** muitl comment
***/
//// single comment
str.replace(/ /,"hello");
</script>
<style type="text/css" >
/*** css comment
! ***/
body
{
font-size: 20px ;
line-height: 150% ;
}
</style>
result:
<!DOCTYPE html>
<textarea>
trim
module
</textarea>
<!--[if IE]> trim module <![endif]-->
<!--[if !IE ]>--> trim module <!--<![endif]-->
<!--# ssi-->
<!--esi-->
<pre style="color: blue">Welcome to nginx!</pre>
<script type="text/javascript">str.replace(/ /,"hello");</script>
<style type="text/css">body{font-size:20px;line-height:150%;}</style>
## Trim Rule
### Html
##### Whitespace
+ Remove '\r'.
+ Replace '\t' with space.
+ Replace multiple spaces with a single space.
+ Replace multiple '\n' with a single '\n'.
+ Replace multiple '\n' and '\t' in tag with a single space.
+ Do not trim quoted strings in tag.
+ Do not trim the contents enclosed by the tag `pre`,`textarea`,`script` and `style`.
##### Comment
+ Remove html comment(`<!-- -->`).
+ Do not trim IE/SSI/ESI comments.
IE comment: `<!--[if <![endif]-->`
SSI comment: `<!--# -->`
ESI comment: `<!--esi -->`
### Javascript
Contents enclosed by `<script type="text/javascript">` or `<script>` will be identified as javascript.
##### Whitespace
+ Remove '\r'.
+ Remove '\t','\n' and space that behind '(',',','=',':','[','!','&','|','?',';','>','~','*','{'.
+ Replace multiple spaces with a single space.
+ Do not trim quoted strings and regular expression literals.
##### Comment
+ Remove single comment. `//`
+ Remove multi comment. `/* */`
### Css
Contents enclosed by `<style type="text/css">` or `<style>` will be identified as css.
##### Whiltespace
+ Remove '\r'.
+ Remove '\t','\n' and space that around ';','>','{','}',':',','.
+ Replace multiple '\n' and spaces with a single space.
+ Do not trim quoted strings.
##### Comment
+ Remove css comment(`/* */`).
+ Do not remove child seletor and IE5 /Mac hack comments.
Child seletor hack: `html>/**/body p{color:blue}`
IE5 /Mac hack: `/*\*/.selector{color:khaki}/**/`

View file

@ -0,0 +1,190 @@
# trim 模块
## 介绍
该模块用于删除 html 内嵌 javascript 和 css 中的注释以及重复的空白符。
## 配置
location / {
trim on;
trim_js on;
trim_css on;
}
## 指令
**trim** `on` | `off`
**默认:** `trim off`
**上下文:** `http, server, location`
使模块有效(失效),删除 html 的注释以及重复的空白符(\n\r\t' ')。
例外:对于 `pre``textarea``script``style` 和 ie/ssi/esi注释 等标签内的内容不作删除操作。
参数值可以包含变量。
例如:
set $flag "off";
if ($condition) {
set $flag "on";
}
trim $flag;
<br/>
**trim_js** `on` | `off`
**默认:** `trim_js off`
**上下文:** `http, server, location`
使模块有效(失效),删除 html 内嵌 javascript 的注释以及重复的空白符(\n\r\t' ')。
例外对于非javascript代码的 `script` 标签内容不作删除操作。
参数值可以包含变量。
<br/>
**trim_css** `on` | `off`
**默认:** `trim_css off`
**上下文:** `http, server, location`
使模块有效(失效),删除 html 内嵌 css 的注释以及重复的空白符(\n\r\t' ')。
例外对于非css代码的 `style` 标签内容不作删除操作。
参数值可以包含变量。
<br/>
**trim_types** `MIME types`
**默认:** `trim_types: text/html`
**上下文:** `http, server, location`
定义哪些[MIME types](http://en.wikipedia.org/wiki/MIME_type)类型的响应可以被处理。
目前只能处理html格式的页面js和css只针对于html内嵌的代码不支持处理单独的js和css页面。
如果这样配置 `trim_type text/javascript;`js代码将被作为html代码来处理而出错。
<br/>
## 调试
添加请求参数http_trim=off将关闭trim功能返回原始代码方便对照调试。
格式如下:
`http://www.xxx.com/index.html?http_trim=off`
## 例子
原始:
<!DOCTYPE html>
<textarea >
trim
module
</textarea >
<!--remove all-->
<!--[if IE]> trim module <![endif]-->
<!--[if !IE ]>--> trim module <!--<![endif]-->
<!--# ssi-->
<!--esi-->
<pre style =
"color: blue" >Welcome to nginx!</pre >
<script type="text/javascript">
/*** muitl comment
***/
//// single comment
str.replace(/ /,"hello");
</script>
<style type="text/css" >
/*** css comment
! ***/
body
{
font-size: 20px ;
line-height: 150% ;
}
</style>
结果:
<!DOCTYPE html>
<textarea>
trim
module
</textarea>
<!--[if IE]> trim module <![endif]-->
<!--[if !IE ]>--> trim module <!--<![endif]-->
<!--# ssi-->
<!--esi-->
<pre style="color: blue">Welcome to nginx!</pre>
<script type="text/javascript">str.replace(/ /,"hello");</script>
<style type="text/css">body{font-size:20px;line-height:150%;}</style>
## trim规则
### html
##### 空白符
+ 正文中的 '\r' 直接删除。
+ 正文中的 '\t' 替换为空格,然后重复的空格保留一个。
+ 正文中重复的 '\n' 保留一个。
+ 标签中的 '\t''\n' 替换为空格,重复的空格保留一个,'=' 前后的空格直接删除,'>' 前面的空格直接删除。
+ 标签的双引号和单引号内的空白符不做删除。
\<div class="no &nbsp; &nbsp; &nbsp; trim"\>
+ `pre``texterea` 标签的内容不做删除。
+ 支持 `pre` 嵌套使用。
+ `script``style` 标签的内容不做删除。
+ ie条件注释的内容不做删除。
+ ssi/esi注释的内容不做删除。
##### 注释
+ 如果是ie条件注释不做删除。
判断规则:`<!--[if <![endif]-->` 之间的内容判断为ie条件注释。
+ 如果是ssi/esi注释的内容不做删除。
判断规则:`<!--# -->` `<!--esi -->` 之间的内容分别判断为ssi和esi注释。
+ 其他正常html注释直接删除. `<!-- -->`
### javascript
借鉴 jsmin 的处理规则 (http://www.crockford.com/javascript/jsmin.html)
`<script type="text/javascript">` 或者 `<script>` 标签认为是javascript。
##### 空白符
+ '(''[''{'';'',''>''=' 后的 '\n''\t',空格 直接删除。
+ '\r' 直接删除。
+ 其他情况 重复的 '\n''\t',空格 保留第一个。
+ 单引号和双引号内不删除。
如下不做操作:
"hello &nbsp; \\\\" &nbsp; world"
'hello &nbsp; \' &nbsp; world'
+ 正则表达式的内容不删除。
判断规则:'/' 前的非空字符是 ',''(''=' 三种的即认为是正则表达式。( 同jsmin的判断)
如下不做操作:
var re=/1 &nbsp; &nbsp; &nbsp;2/;
data.match(/1 &nbsp; &nbsp; 2/);
##### 注释
+ 删除单行注释。 `//`
+ 删除多行注释。 `/* */`
注意javascript也有一种条件注释不过貌似用得很少jsmin直接删除的trim也是直接删除。
http://en.wikipedia.org/wiki/Conditional_comment
### css
借鉴 YUI Compressor 的处理规则 (http://yui.github.io/yuicompressor/css.html)
`<style type="text/css">` 或者 `<style>` 标签认为是css。
##### 空白符
+ ';''>''{''}'':'',' 前后的 '\n''\t',空格 直接删除。
+ '\r' 直接删除。
+ 其他情况 连续的 '\n' '\t' 和 空格 保留为一个空格。
+ 单引号和双引号内不删除。
如下不做操作:
"hello &nbsp; \\\\\" &nbsp; world"
'hello &nbsp; \' &nbsp; &nbsp; world'
##### 注释
+ child seletor hack的注释不删除。
`html>/**/body p{color:blue}`
+ IE5 /Mac hack 的注释不删除。
`/*\*/.selector{color:khaki}/**/`
+ 其他情况删除注释。 `/* */`

View file

@ -0,0 +1,199 @@
# Name #
**ngx\_http\_upstream\_check\_module**
Add proactive health check for the upstream servers.
This module is not built by default, it should be enabled with the `--with-http_upstream_check_module` configuration parameter.
# Examples #
http {
upstream cluster1 {
# simple round-robin
server 192.168.0.1:80;
server 192.168.0.2:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "HEAD / HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
upstream cluster2 {
# simple round-robin
server 192.168.0.3:80;
server 192.168.0.4:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_keepalive_requests 100;
check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
server {
listen 80;
location /1 {
proxy_pass http://cluster1;
}
location /2 {
proxy_pass http://cluster2;
}
location /status {
check_status;
access_log off;
allow SOME.IP.ADD.RESS;
deny all;
}
}
}
# Directives #
## check ##
Syntax: **check** `interval=milliseconds [fall=count] [rise=count] [timeout=milliseconds] [default_down=true|false] [type=tcp|http|ssl_hello|mysql|ajp] [port=check_port]`
Default: If the parameters are omitted, default values are: `interval=30000 fall=5 rise=2 timeout=1000 default_down=true type=tcp`
Context: `upstream`
Add health check for the upstream servers.
Passive health checking should not be enabled, as they may interfere. So do not use fail_timeout for the servers in the upstream context for which proactive health checking is enabled.
The parameters' meanings are:
* `interval`: the check request's interval time.
* `fall`(fall\_count): After fall\_count failure checks, the server is marked down.
* `rise`(rise\_count): After rise\_count successful checks, the server is marked up.
* `timeout`: the check request's timeout.
* `default_down`: specify initial state of backend server, default is down.
* `type`: the check protocol type:
- `tcp`: a simple TCP socket connect and peek one byte.
- `ssl_hello`: send a client SSL hello packet and receive the server SSL hello packet.
- `http`: send a http request packet, receive and parse the http response to diagnose if the upstream server is alive.
- `mysql`: connect to the mysql server, receive the greeting response to diagnose if the upstream server is alive.
- `ajp`: send an AJP Cping packet, receive and parse the AJP Cpong response to diagnose if the upstream server is alive.
* `port`: specify the check port in the backend servers. It can be different with the original servers port. Default the port is 0 and it means the same as the original backend server. This option is added after tengine-1.4.0.
## check\_keepalive\_requests ##
Syntax: **check\_keepalive\_requests** `request_num`
Default: `1`
Context: `upstream`
The directive specifies the number of requests sent on a connection, the default vaule 1 indicates that tengine will certainly close the connection after a request.
This directive was first introduced in Tengine-2.0.0.
## check\_http\_send ##
Syntax: **check\_http\_send** `http_packet`
Default: `"GET / HTTP/1.0\r\n\r\n"`
Context: `upstream`
If the check type is http, the check function will send this http packet to the upstream server. Method "HEAD" is recommended for reducing traffic.
When persistant connection is used, a keep-alive request header should be added to the value of the directive, e.g. `"HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n"`.
In addition, in the case of "GET" method, size of the request uri should not be too large, make sure the transmission can be finished within an `interval`, otherwise the health check will deduce a conclusion that there is something wrong with the servers or the net.
## check\_http\_expect\_alive ##
Syntax: **check\_http\_expect\_alive** `[ http_2xx | http_3xx | http_4xx | http_5xx ]`
Default: `http_2xx http_3xx`
Context: `upstream`
These status codes indicate the upstream server's http response is OK and the check response is successful.
## check\_shm\_size ##
Syntax: **check\_shm\_size** `size`
Default: `1M`
Context: `http`
Default size is one megabytes. If you want to check thousands of servers, the shared memory may be not enough, you can enlarge it with this directive.
## check\_status ##
Syntax: **check\_status** `[html|csv|json]`
Default: `check_status html`
Context: `location`
Display the status of checking servers. This directive should be used in the http block.
You can specify the default display format after Tengine-1.4.0. The formats can be `html`, `csv` or `json`. The default type is `html`. It also supports to specify the format by the request argument. Suppose your `check_status` location is '/status', the argument of `format` can change the display page's format. You can do like this:
/status?format=html
/status?format=csv
/status?format=json
At present, you can fetch the list of servers with the same status by the argument of `status`. For example:
/status?format=html&status=down
/status?format=csv&status=up
Below it's the sample html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nginx http upstream check status</title>
</head>
<body>
<h1>Nginx http upstream check status</h1>
<h2>Check upstream server number: 1, generation: 3</h2>
<table style="background-color:white" cellspacing="0" cellpadding="3" border="1">
<tr bgcolor="#C0C0C0">
<th>Index</th>
<th>Upstream</th>
<th>Name</th>
<th>Status</th>
<th>Rise counts</th>
<th>Fall counts</th>
<th>Check type</th>
<th>Check port</th>
</tr>
<tr>
<td>0</td>
<td>backend</td>
<td>192.168.0.1:80</td>
<td>up</td>
<td>39</td>
<td>0</td>
<td>http</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Below it's the sample of csv page:
0,backend,192.168.0.1:80,up,46,0,http,80
Below it's the sample of json page:
{"servers": {
"total": 1,
"generation": 3,
"server": [
{"index": 0, "upstream": "backend", "name": "192.168.0.1:80", "status": "up", "rise": 58, "fall": 0, "type": "http", "port": 80}
]
}}

View file

@ -0,0 +1,212 @@
# Name #
**ngx\_http\_upstream\_check\_module**
该模块可以为Tengine提供主动式后端服务器健康检查的功能。
该模块没有默认开启,它可以在配置编译选项的时候开启:`./configure --with-http_upstream_check_module`
# Examples #
http {
upstream cluster1 {
# simple round-robin
server 192.168.0.1:80;
server 192.168.0.2:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "HEAD / HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
upstream cluster2 {
# simple round-robin
server 192.168.0.3:80;
server 192.168.0.4:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_keepalive_requests 100;
check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
server {
listen 80;
location /1 {
proxy_pass http://cluster1;
}
location /2 {
proxy_pass http://cluster2;
}
location /status {
check_status;
access_log off;
allow SOME.IP.ADD.RESS;
deny all;
}
}
}
# 指令 #
## check ##
Syntax: **check** `interval=milliseconds [fall=count] [rise=count] [timeout=milliseconds] [default_down=true|false] [type=tcp|http|ssl_hello|mysql|ajp] [port=check_port]`
Default: 如果没有配置参数,默认值是:`interval=30000 fall=5 rise=2 timeout=1000 default_down=true type=tcp`
Context: `upstream`
该指令可以打开后端服务器的健康检查功能。
指令后面的参数意义是:
* `interval`:向后端发送的健康检查包的间隔。
* `fall`(fall\_count): 如果连续失败次数达到fall\_count服务器就被认为是down。
* `rise`(rise\_count): 如果连续成功次数达到rise\_count服务器就被认为是up。
* `timeout`: 后端健康请求的超时时间。
* `default_down`: 设定初始时服务器的状态如果是true就说明默认是down的如果是false就是up的。默认值是true也就是一开始服务器认为是不可用要等健康检查包达到一定成功次数以后才会被认为是健康的。
* `type`:健康检查包的类型,现在支持以下多种类型
- `tcp`简单的tcp连接如果连接成功就说明后端正常。
- `ssl_hello`发送一个初始的SSL hello包并接受服务器的SSL hello包。
- `http`发送HTTP请求通过后端的回复包的状态来判断后端是否存活。
- `fastcgi`发送fsatcgi请求通过后端的回复包的状态来判断后端是否存活。
- `mysql`: 向mysql服务器连接通过接收服务器的greeting包来判断后端是否存活。
- `ajp`向后端发送AJP协议的Cping包通过接收Cpong包来判断后端是否存活。
* `port`: 指定后端服务器的检查端口。你可以指定不同于真实服务的后端服务器的端口比如后端提供的是443端口的应用你可以去检查80端口的状态来判断后端健康状况。默认是0表示跟后端server提供真实服务的端口一样。该选项出现于Tengine-1.4.0。
## check\_keepalive\_requests ##
Syntax: **check\_keepalive\_requests** `request_num`
Default: `1`
Context: `upstream`
该指令可以配置一个连接发送的请求数其默认值为1表示Tengine完成1次请求后即关闭连接。
该指令在Tengine-2.0.0首次被引入。
## check\_http\_send ##
Syntax: **check\_http\_send** `http_packet`
Default: `"GET / HTTP/1.0\r\n\r\n"`
Context: `upstream`
该指令可以配置http健康检查包发送的请求内容。为了减少传输数据量推荐采用`"HEAD"`方法。
当采用长连接进行健康检查时需在该指令中添加keep-alive请求头`"HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n"`。
同时,在采用`"GET"`方法的情况下请求uri的size不宜过大确保可以在1个`interval`内传输完成,否则会被健康检查模块视为后端服务器或网络异常。
## check\_fastcgi\_param ##
Syntax: **check\_fastcgi\_params** `parameter`:`value`
Default: `REQUEST_METHOD: GET`
`REQUEST_URI: /`
`SCRIPT_FILENAME: index.php'
Context: `upstream`
该指令可以配置fastcgi健康检查包发送的请求的header项。
## check\_http\_expect\_alive ##
Syntax: **check\_http\_expect\_alive** `[ http_2xx | http_3xx | http_4xx | http_5xx ]`
Default: `http_2xx | http_3xx`
Context: `upstream`
该指令指定HTTP回复的成功状态默认认为2XX和3XX的状态是健康的。
## check\_shm\_size ##
Syntax: **check\_shm\_size** `size`
Default: `1M`
Context: `http`
所有的后端服务器健康检查状态都存于共享内存中该指令可以设置共享内存的大小。默认是1M如果你有1千台以上的服务器并在配置的时候出现了错误就可能需要扩大该内存的大小。
## check\_status ##
Syntax: **check\_status** `[html|csv|json]`
Default: `check_status html`
Context: `location`
显示服务器的健康状态页面。该指令需要在http块中配置。
在Tengine-1.4.0以后,你可以配置显示页面的格式。支持的格式有: `html`、`csv`、 `json`。默认类型是`html`。
你也可以通过请求的参数来指定格式,假设‘/status是你状态页面的URL `format`参数改变页面的格式,比如:
/status?format=html
/status?format=csv
/status?format=json
同时你也可以通过status参数来获取相同服务器状态的列表比如
/status?format=html&status=down
/status?format=csv&status=up
下面是一个HTML状态页面的例子server number是后端服务器的数量generation是Nginx reload的次数。Index是服务器的索引Upstream是在配置中upstream的名称Name是服务器IPStatus是服务器的状态Rise是服务器连续检查成功的次数Fall是连续检查失败的次数Check type是检查的方式Check port是后端专门为健康检查设置的端口
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nginx http upstream check status</title>
</head>
<body>
<h1>Nginx http upstream check status</h1>
<h2>Check upstream server number: 1, generation: 3</h2>
<table style="background-color:white" cellspacing="0" cellpadding="3" border="1">
<tr bgcolor="#C0C0C0">
<th>Index</th>
<th>Upstream</th>
<th>Name</th>
<th>Status</th>
<th>Rise counts</th>
<th>Fall counts</th>
<th>Check type</th>
<th>Check port</th>
</tr>
<tr>
<td>0</td>
<td>backend</td>
<td>192.168.0.1:80</td>
<td>up</td>
<td>39</td>
<td>0</td>
<td>http</td>
<td>80</td>
</tr>
</table>
</body>
</html>
下面是csv格式页面的例子
0,backend,192.168.0.1:80,up,46,0,http,80
下面是json格式页面的例子
{"servers": {
"total": 1,
"generation": 3,
"server": [
{"index": 0, "upstream": "backend", "name": "106.187.48.116:80", "status": "up", "rise": 58, "fall": 0, "type": "http", "port": 80}
]
}}

View file

@ -0,0 +1,72 @@
Name
====
* consistent hash module
Description
===========
* This module provides consistent hashing algorithm for upstream load-balancing.
* If one of backend servers is down, the request of this client will be transferred to another server.
* `server` *id* field: Id field can be used as server flag. If id field is not set, ip address and port are used to identify server. You can use id field to set server flag mannually. In that case, although ip address or port of a server is changed, id can still identify the server. BTW, it can reduce remapping keys effectively to use id field.
* `server` *weight* field: server weight, the number of virtual peers
* Algorithm: It supposes that 1 server is mapped to m virtual peers, so n servers correspond to n*m virtual peers. All these peers will be mapped to hash ring on average. Every time request comes, it calculates a hash key via configuration parameter, and finds a peer on the hash ring nearest to the location specified by the hash key.
* It can dispatch requests to backend servers on average according to nginx configuration parameter.
`consistent_hash $remote_addr`: mapping via client ip address
`consistent_hash $request_uri`: mapping via request-uri
`consistent_hash $args`: mapping via url query string
Example
===========
worker_processes 1;
http {
upstream test {
consistent_hash $request_uri;
server 127.0.0.1:9001 id=1001 weight=3;
server 127.0.0.1:9002 id=1002 weight=10;
server 127.0.0.1:9003 id=1003 weight=20;
}
}
Directives
==========
consistent_hash
------------------------
**Syntax**: *consistent_hash variable_name*
**Default**: *none*
**Context**: *upstream*
This directive causes requests to be distributed between upstreams based on consistent hashing alogrithm. And it uses nginx variables, specified by variable_name, as input data of hash function.
Installation
===========
* This module is built by default, it can be disabled with the `--without-http_upstream_consistent_hash_module` configuration parameter.
$ ./configure
* compile
$ make
* install
$ make install

View file

@ -0,0 +1,81 @@
模块名
====
* 一致性hash模块
描述
===========
* 这个模块提供一致性hash作为负载均衡算法。
* 该模块通过使用客户端信息(如:$ip, $uri, $args等变量)作为参数使用一致性hash算法将客户端映射到后端机器
* 如果后端机器宕机,这请求会被迁移到其他机器
* `server` *id* 字段如果配置id字段则使用id字段作为server标识否则使用server ip和端口作为server标识
使用id字段可以手动设置server的标识比如一台机器的ip或者端口变化id仍然可以表示这台机器。使用id字段
可以减低增减服务器时hash的波动。
* `server` *wegiht* 字段作为server权重对应虚拟节点数目
* 具体算法假设每个server对应n个虚拟节点那m个server就对应n×m个虚拟节点这些节点被均匀分布到hash环上。
每次请求进入时模块根据配置的参数计算出一个hash值在hash环上查找离这个hash值最近的虚拟节点并将此
节点对应的server作为该次请求的后端机器。
* 该模块可以根据配置参数采取不同的方式将请求均匀映射到后端机器,比如:
`consistent_hash $remote_addr`可以根据客户端ip映射
`consistent_hash $request_uri` 根据客户端请求的uri映射
`consistent_hash $args`:根据客户端携带的参数进行映射
例子
===========
worker_processes 1;
http {
upstream test {
consistent_hash $request_uri;
server 127.0.0.1:9001 id=1001 weight=3;
server 127.0.0.1:9002 id=1002 weight=10;
server 127.0.0.1:9003 id=1003 weight=20;
}
}
指令
==========
consistent_hash
------------------------
**Syntax**: *consistent_hash variable_name*
**Default**: *none*
**Context**: *upstream*
配置upstream采用一致性hash作为负载均衡算法variable_name作为hash输入可以使用nginx变量。
编译安装
===========
* configure默认打开一致性hash模块若要关闭请使用选项`--without-http_upstream_consistent_hash_module`。
$ ./configure
* 编译
$ make
* 安装模块
$ make install

View file

@ -0,0 +1,47 @@
Name
====
* ngx_http_upstream_dynamic_module
Description
===========
* This module provides the functionality to resolve domain names into IP addresses in an upstream at run-time.
Examples
========
upstream backend {
dynamic_resolve fallback=stale fail_timeout=30s;
server a.com;
server b.com;
}
server {
...
proxy_pass http://backend;
}
Directives
==========
dynamic_resolve
---------------
**Syntax**: *dynamic_resolve [fallback=stale|next|shutdown] [fail_timeout=time]*
**Default**: *-*
**Context**: *upstream*
Enable dynamic DNS resolving functionality in an upstream.
The 'fallback' parameter specifies what action to take if a domain name can not be resolved into an IP address:
* stale, use the original IP addresses resolved when tengine starts.
* next, go to next availiable server in the upstream.
* shutdown, finalize current request.
The 'fail_timeout' parameter specifies how long time tengine considers the DNS server as unavailiable if a DNS query fails for a server in the upstream. In this period of time, all requests comming will follow what 'fallback' specifies.

View file

@ -0,0 +1,47 @@
模块名
=====
* ngx_http_upstream_dynamic_module
介绍
===
* 此模块提供了在运行时动态解析upstream中server域名的功能
配置示例
=======
upstream backend {
dynamic_resolve fallback=stale fail_timeout=30s;
server a.com;
server b.com;
}
server {
...
proxy_pass http://backend;
}
指令
===
dynamic_resolve
---------------
**语法**: *dynamic_resolve [fallback=stale|next|shutdown] [fail_timeout=time]*
**默认值**: *-*
**上下文**: *upstream*
指定在某个upstream中启用动态域名解析功能。
fallback参数指定了当域名无法解析时采取的动作
* stale, 使用tengine启动的时候获取的旧地址
* next, 选择upstream中的下一个server
* shutdown, 结束当前请求
fail_timeout参数指定了一个时间在这个时间范围内DNS服务将被当作无法使用。具体来说就是当某次DNS请求失败后假定后续多长的时间内DNS服务依然不可用以减少对无效DNS的查询。

View file

@ -0,0 +1,78 @@
# Name
**ngx\_http\_upstream\_session\_sticky\_module**
This module is a load balancing module. It sticks the session between client and backend server via cookie. In such case, it guarantees that requests from the same client are distributed to the same server.
# Example 1#
# default: cookie=route mode=insert fallback=on
upstream foo {
server 192.168.0.1;
server 192.168.0.2;
session_sticky;
}
server {
location / {
proxy_pass http://foo;
}
}
# Example 2#
# insert + indirect mode:
upstream test {
session_sticky session_sticky cookie=uid domain=www.xxx.com fallback=on path=/ mode=insert option=indirect;
server 127.0.0.1:8080;
}
server {
location / {
# You need configure session_sticky_hide_cookie in insert + indirect mode or prefix mode.
# It removes the cookie before sending to backend server, and the backend server will not
# receive and process this extra cookie.
session_sticky_hide_cookie upstream=test;
proxy_pass http://test;
}
}
# Directive #
## session_sticky ##
Syntax: **session_sticky** `[cookie=name] [domain=your_domain] [path=your_path] [maxage=time] [mode=insert|rewrite|prefix] [option=indirect] [maxidle=time] [maxlife=time] [fallback=on|off] [hash=plain|md5]`
Default: `session_sticky cookie=route mode=insert fallback=on`
Context: `upstream`
Description:
This directive will turn on the session sticky module. Specific parameters are as follows:
+ `cookie` sets name of session cookie.
+ `domain` sets domain of cookie. It is not set by default.
+ `path` sets url path of cookie. The default value is '/'.
+ `maxage` set lifetime of cookie (cookie max-age attribute). If not set, it's a session cookie. It expires when the browser is closed.
+ `mode` sets mode of cookie:
- **insert**: This mode inserts cookie into http response via Set-Cookie header.
- **prefix**: This mode doesn't generate new cookie, but it inserts specific prefix ahead of cookie value of http response (e.g. "Cookie: NAME=SRV~VALUE"). When client(browser) requests next time with this specific cookie, it will delete inserted prefix before passing request to backend server. The operation is transparent to backend server which will get origin cookie .
- **rewrite**: In this mode, backend server can set cookie of session sticky itself. If backend server doesn't set this cookie in response, it disables session sticky for this request. In this mode, backend server manages which request needs sesstion sticky.
+ `option` sets option value(indirect and direct) for cookie of session sticky. If setting indirect, it hides cookie of session sticky from backend server, otherwise the opposite.
+ `maxidle` sets max idle time of session.
+ `maxlife` sets max lifetime of session.
+ `fallback` sets whether it can retry others when current backend server is down.
+ `hash` sets whether server flag in cookie is passed through plaintext or md5. By default, md5 is used.
## session\_sticky\_hide\_cookie ##
Syntax: **session\_sticky\_hide\_cookie** upstream=name;
Default: none
Context: server, location
Description:
This directive works with proxy_pass directive. It deletes cookie used as session sticky in insert+indirect and prefix mode, in which case cookie will be hidden from backend server. Upstream name specifies which upstream this directive takes effect in.

View file

@ -0,0 +1,77 @@
# Name 模块
**ngx\_http\_upstream\_session\_sticky\_module**
该模块是一个负载均衡模块通过cookie实现客户端与后端服务器的会话保持, 在一定条件下可以保证同一个客户端访问的都是同一个后端服务器。
# Example 1#
# 默认配置cookie=route mode=insert fallback=on
upstream foo {
server 192.168.0.1;
server 192.168.0.2;
session_sticky;
}
server {
location / {
proxy_pass http://foo;
}
}
# Example 2#
#insert + indirect模式
upstream test {
session_sticky session_sticky cookie=uid domain=www.xxx.com fallback=on path=/ mode=insert option=indirect;
server 127.0.0.1:8080;
}
server {
location / {
#在insert + indirect模式或者prefix模式下需要配置session_sticky_hide_cookie
#这种模式不会将保持会话使用的cookie传给后端服务让保持会话的cookie对后端透明
session_sticky_hide_cookie upstream=test;
proxy_pass http://test;
}
}
# 指令 #
## session_sticky ##
语法:**session_sticky** `[cookie=name] [domain=your_domain] [path=your_path] [maxage=time] [mode=insert|rewrite|prefix] [option=indirect] [maxidle=time] [maxlife=time] [fallback=on|off] [hash=plain|md5]`
默认值:`session_sticky cookie=route mode=insert fallback=on`
上下文:`upstream`
说明:
本指令可以打开会话保持的功能,下面是具体的参数:
+ `cookie`设置用来记录会话的cookie名称
+ `domain`设置cookie作用的域名默认不设置
+ `path`设置cookie作用的URL路径默认不设置
+ `maxage`设置cookie的生存期默认不设置即为session cookie浏览器关闭即失效
+ `mode`设置cookie的模式:
- **insert**: 在回复中本模块通过Set-Cookie头直接插入相应名称的cookie。
- **prefix**: 不会生成新的cookie但会在响应的cookie值前面加上特定的前缀当浏览器带着这个有特定标识的cookie再次请求时模块在传给后端服务前先删除加入的前缀后端服务拿到的还是原来的cookie值这些动作对后端透明。如"Cookie: NAME=SRV~VALUE"。
- **rewrite**: 使用服务端标识覆盖后端设置的用于session sticky的cookie。如果后端服务在响应头中没有设置该cookie则认为该请求不需要进行session sticky使用这种模式后端服务可以控制哪些请求需要sesstion sticky哪些请求不需要。
+ `option` 设置用于session sticky的cookie的选项可设置成indirect或direct。indirect不会将session sticky的cookie传送给后端服务该cookie对后端应用完全透明。direct则与indirect相反。
+ `maxidle`设置session cookie的最长空闲的超时时间
+ `maxlife`设置session cookie的最长生存期
+ `fallback`设置是否重试其他机器当sticky的后端机器挂了以后是否需要尝试其他机器
+ `hash` 设置cookie中server标识是用明文还是使用md5值默认使用md5
## session\_sticky\_hide\_cookie ##
语法: **session\_sticky\_hide\_cookie** upstream=name;
默认值: none
上下文: server, location
说明:
配合proxy_pass指令使用。用于在insert+indirect模式和prefix模式下删除请求用于session sticky的cookie这样就不会将该cookie传递给后端服务。upstream表示需要进行操作的upstream名称。

View file

@ -0,0 +1,60 @@
# Name #
**ngx\_http\_user\_agent\_module**
This module can analyse the header of User-Agent.
This module is enabled by default. It can be disabled with the --without-http_user_agent_module configuration parameter.
# Examples #
http {
user_agent $ngx_browser {
default unknown;
greedy Firefox;
Chrome 18.0+ chrome18;
Chrome 17.0~17.9999 chrome17;
Chrome 5.0- chrome_low;
}
}
# Directives #
## user_agent ##
Syntax: **user_agent** $variable_name
Default: none
Context: http
Set a variable whose value depends on the value of user_agent string.This block contains three parts, **default**, **greedy** and **analysis items**.
### default:
*Syntax*: **default** value
*Default*: none
*Context*: user_agent block
The default variable value if the user_agent string can't match any of the item.
### greedy:
*Syntax*: **greedy keyword**
*Default*: none
*Context*: user_agent block
If the keyword is greedy, it will continue to scan the user-agent string until it can find other item which is not greedy. If it can't find any other item, this keyword will be returned at last.
e.g.: "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1",this user_agent string will return Chrome13,if configuration file like this:
greedy Safari;
Chrome 13.0~13.9999 chrome13;
### analysis items:
*Syntax*: **keyword version value**
*Default*: none
*Context*: user_agent block
* *keyword*: This is the word we want to match from the user_agent string.
* *version*: the version of keyword.
- version\+:greater or equal should be matched;
- version\-:less or equal should be matched;
- version:equal should be matched;
- version1~version2:matched in [version1,version2];
* *value*:If this item is matched, the value will be filled to the defined variable.

View file

@ -0,0 +1,78 @@
# Name #
**limit upstream retries**
Limits retries for upstream servers (proxy, memcached, fastcgi, scgi, uwsgi).
Using one of the directives below will enable this feature.
# Example #
http {
upstream test {
server 127.0.0.1:8081;
server 127.0.0.2:8081;
server 127.0.0.3:8081;
server 127.0.0.4:8081;
}
server {
proxy_upstream_tries 2;
proxy_set_header Host $host;
location / {
proxy_pass test;
}
}
}
# Directives #
## fastcgi\_upstream\_tries ##
Syntax: **fastcgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
Limit the maximum number of tries for fastcgi proxy. Nginx tries to connect different server each time.
## proxy\_upstream\_tries ##
Syntax: **proxy\_upstream\_tries** num
Default: -
Context: http, server, locatioon
Limit the maximum number of tries for http proxy. Nginx tries to connect different server each time.
## memcached\_upstream\_tries ##
Syntax: **memcached\_upstream\_tries** num
Default: -
Context: http, server, locatioon
Limit the maximum number of tries for memcached proxy. Nginx tries to connect different server each time.
## scgi\_upstream\_tries ##
Syntax: **scgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
Limit the maximum number of tries for scgi proxy. Nginx tries to connect different server each time.
## uwsgi\_upstream\_tries ##
Syntax: **uwsgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
Limit the maximum number of tries for uwsgi proxy. Nginx tries to connect different server each time.

View file

@ -0,0 +1,78 @@
# Name #
**limit upstream retries**
限制每个请求对后端服务器访问的最大尝试次数支持proxy、memcached、fastcgi、scgi和uwsgi模块。
可以使用下面的指令开启访问次数进行限制。
# Example #
http {
upstream test {
server 127.0.0.1:8081;
server 127.0.0.2:8081;
server 127.0.0.3:8081;
server 127.0.0.4:8081;
}
server {
proxy_upstream_tries 2;
proxy_set_header Host $host;
location / {
proxy_pass test;
}
}
}
# 指令 #
## fastcgi\_upstream\_tries ##
Syntax: **fastcgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
限制fastcgi代理的后端尝试次数。
## proxy\_upstream\_tries ##
Syntax: **proxy\_upstream\_tries** num
Default: -
Context: http, server, locatioon
限制proxy代理的后端尝试次数。
## memcached\_upstream\_tries ##
Syntax: **memcached\_upstream\_tries** num
Default: -
Context: http, server, locatioon
限制memcached代理的后端尝试次数。
## scgi\_upstream\_tries ##
Syntax: **scgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
限制scgi代理的后端尝试次数。
## uwsgi\_upstream\_tries ##
Syntax: **uwsgi\_upstream\_tries** num
Default: -
Context: http, server, locatioon
限制uwsgi代理的后端尝试次数。

View file

@ -0,0 +1,86 @@
# Name #
## Proc Module ##
provides a mechanism to support standalone processes
# Code Examples #
a daytime server module, run in a standalone process.
http://tengine.taobao.org/examples/ngx_proc_daytime_module
# Examples #
processes {
process echo {
eho_str "hello, world";
echo on;
listen 8888;
count 1;
priority 1;
delay_start 10s;
respawn off;
}
process example {
count 1;
priority 0;
delay_start 0s;
respawn on;
}
}
# Directives #
## process ##
Syntax: **process** `name { }`
Default: `none`
Context: `processes`
## count ##
Syntax: **count** `num`
Default: `1`
Context: `process`
Specify the number of processes which will be forked.
## priority ##
Syntax: **priority** `num`
Default: `0`
Context: `process`
Priority is a value in the range -20 to 20. Lower priorities cause more favorable scheduling.
## delay\_start ##
Syntax: **delay\_start** `time`
Default: `300ms`
Context: `process`
The directive specifies the time to wait before process starts.
## respawn ##
Syntax: **respawn** `on | off`
Default: `on`
Context: `process`
The directive specifies whether the process will be restarted by nginx when it encounters some errors and exits.

Some files were not shown because too many files have changed in this diff Show more