天天看点

nginx源码学习资源(不断更新)

nginx源码学习是一个痛苦又快乐的过程,下面列出了一些nginx的学习资源。

首先要做的当然是下载一份nginx源码,可以从nginx官方网站下载一份最新的。

看了nginx源码,发现这是一份完全没有注释,完全没有配置文档的代码。

现在你最希望要的是一份注释版的nginx源码,可以从下面的链接中下载一份:

<a href="https://github.com/jianfengye/nginx-1.0.14_comment">https://github.com/jianfengye/nginx-1.0.14_comment</a>

这份注释版源码会不断进行更新的

好了,第一个问题, nginx的main函数在哪里呢?

src/core/nginx.c

第二个问题,nginx启动的时候都做了哪些事情呢?参考下面两篇文章:

<a href="http://www.pagefault.info/?p=188">http://www.pagefault.info/?p=188</a>

<a href="http://www.pagefault.info/?p=201&amp;cpage=1">http://www.pagefault.info/?p=201&amp;cpage=1</a>

nginx启动的命令是nginx,重启的命令是nginx -s reload, nginx有master和worker进程,他们之间是怎么通信的呢?可以参考下面的文章:

<a href="http://simohayha.iteye.com/blog/467940">http://simohayha.iteye.com/blog/467940</a>

好了,是不是手痒痒了?希望对nginx进行调试?

你是linux程序员? 使用gdb调试吧。

nginx如何调试  http://doyoueat.iteye.com/blog/1291164

gdb调试nginx:

<a href="http://www.cnblogs.com/yjf512/archive/2012/05/10/2494635.html">http://www.cnblogs.com/yjf512/archive/2012/05/10/2494635.html</a>

你是windows程序员?想使用vs调试nginx?行

这有个可调试工程:

<a href="http://liyongping.sinaapp.com/?p=116">http://liyongping.sinaapp.com/?p=116</a>

如何编写nginx的第三方模块?miller的文章很好,codinglabs的文章也不错,推荐

<a href="http://www.codinglabs.org/html/intro-of-nginx-module-development.html">http://www.codinglabs.org/html/intro-of-nginx-module-development.html</a>

<a href="http://www.evanmiller.org/nginx-modules-guide.html">http://www.evanmiller.org/nginx-modules-guide.html</a>

nginx的基本类型有非常多,那些类型各个类型是那些意思

这类的文章有很多很多,google一下能找出很多

推荐几个人的博客:

<a href="http://blog.csdn.net/livelylittlefish/article/details/7262750">http://blog.csdn.net/livelylittlefish/article/details/7262750</a>

<a href="http://blog.csdn.net/dingyujie/article/details/7162919">http://blog.csdn.net/dingyujie/article/details/7162919</a>

nginx开发从入门到精通  http://tengine.taobao.org/book/

注:淘宝一批大牛做的,很多东西讲的非常详细。也很系统,强烈推荐

nginx模块开发入门  http://www.162cm.com/p/ngx_ext.html

注:入门教程

教程书:

《深入理解nginx -- 模块开发与架构解析》 陶辉

注:非常系统的讲了nginx的模块开发与架构

《深入剖析nginx》 高群凯

继续阅读