Skip to content

lucasrodcosta/nginx-studies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nginx studies

A set of studies about how Nginx works and how it interacts with the operating system under the hoods.

Each directory is a study, with a README file containing the instructions to reproduce it, some logs and notes.

Requirements

All studies requires an OpenResty docker image with debug flag and strace.

  1. Clone the docker-openresty repo

  2. Add the flag --with-debug inside the RESTY_CONFIG_OPTIONS in file alpine/Dockerfile:

    ARG RESTY_CONFIG_OPTIONS="\
    --with-debug \
    --with-compat \
    // other lines
  3. Add the instruction RUN apk add strace before the copy of Nginx conf files in alpine/Dockerfile:

    # Add additional binaries into PATH for convenience
    ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
    
    RUN apk add strace
    
    # Copy nginx configuration files
    COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
  4. Build the Nginx:

    docker build -t openresty-with-debug:latest -f alpine/Dockerfile .

How to run the images of the studies

  1. Run Nginx:

    make run
  2. In another terminal, attach the strace process to Nginx:

    make strace
  3. In another terminal, reload the Nginx:

    make reload
  4. Make the requests. Each study has its own instructions about this step.

About

A collection of studies with Nginx

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published