<br><div class="gmail_extra">Hi Zhiming!<br><br><div class="gmail_quote">On Tue, Dec 11, 2012 at 10:55 PM, 王志明 <span dir="ltr"><<a href="mailto:wangzhiming1757@gmail.com" target="_blank">wangzhiming1757@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">hi all,<div><br></div><div>I am a fresh man to nginx, who can tell me how to read the nginx source code in general, i just trace the source from main() entry, if this is the right  manner.</div>

<div><br></div><div>and any related documents are welcomed.</div></blockquote><div><br></div><div>There are some great guides on the web to get started :<br></div><div><br></div><div>Evan Miller Guide To Nginx Module Development [1] and advanced topics [2]</div>

<div>A bit old, but definitely not dated if you want to learn how it works inside.</div><div><br></div><div>Nginx Guts [3] also has quite a few articles on the core of Nginx.</div><div><br></div><div>If you're interested in adding new features, you can find many Nginx [4] or 3rd-party modules [5], </div>

<div>they all add new extensions and capabilities to the core of Nginx.</div><div><br></div><div>As for the main() I think it parses the command line options, reads the configuration and spawn the worker processes.</div>
<div>
Then each worker process will start accepting and processing HTTP requests.</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Matthieu.</div><div><br></div><div><br></div><div>[1] <a href="http://www.evanmiller.org/nginx-modules-guide.html">http://www.evanmiller.org/nginx-modules-guide.html</a><br>

</div><div>[2] <a href="http://www.evanmiller.org/nginx-modules-guide-advanced.html">http://www.evanmiller.org/nginx-modules-guide-advanced.html</a></div><div>[3] <a href="http://www.nginxguts.com/2011/01/phases/">http://www.nginxguts.com/2011/01/phases/</a><br>

</div><div>[4] <a href="http://wiki.nginx.org/Modules">http://wiki.nginx.org/Modules</a><br></div><div>[5] <a href="http://wiki.nginx.org/3rdPartyModules">http://wiki.nginx.org/3rdPartyModules</a><br></div></div></div>