Giter Club home page Giter Club logo

reading-source-code-of-nginx-1.19.10's Introduction

1. nginx 源码目录结构

.
├── auto          # 与编译相关的一些脚本文件,可执行文件 configure 将会使用到该目录下的文件
├── conf          # 默认的配置文件,比如 nginx.conf、uwsgi_params
├── contrib       # 脚本和工具,比较典型的就是 vim 高亮工具
├── html          # 就两个文件, 50x.html 和 index.html,index.html 就是 Welcome to nginx! 页面
├── man           # 帮助文件目录
├── objs          # 编译产生的临时文件
└── src           # 核心源码目录文件,包含了 nginx 运行的核心源码文件
    ├── core      # nginx 核心源码文件,包含了程序入口函数、数据结构的定义,以及 nginx 运行时的核心代码
    ├── event     # epoll 事件模型相关代码
    ├── http      # http 模块相关源码
    ├── mail      # mail 模块相关源码
    ├── misc      # 杂项,一些辅助代码
    ├── os        # 于 unix 操作系统相关的内容,可以认为是对 POSIX API 的一个封装
    └── stream    # stream 模块相关代码

如果以理解 nginx 的运行机理为目标的话,那么只需要阅读几个核心目录下的源码文件即可,包括 src/core, src/event, src/http 以及 src/stream

其中 src/http 以及 src/stream 主要包含的是 HTTP 框架和 stream 机制的相关内容。而src/coresrc/event 则是 nginx 运行时的核心代码文件,其中也隐藏着为什么 nginx 支持单机数十万的并发,以及 nginx 为什么运行如此之稳定的奥秘。

2. 前置知识点

3. nginx 核心数据结构与关键流程

3.1 核心结构概览

img_1.png

3.2 Nginx 相关内容解析

  1. Nginx 数据结构

reading-source-code-of-nginx-1.19.10's People

Contributors

smartkeyerror avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.