Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasrodcosta/nginx-studies
A collection of studies with Nginx
https://github.com/lucasrodcosta/nginx-studies
nginx
Last synced: 4 days ago
JSON representation
A collection of studies with Nginx
- Host: GitHub
- URL: https://github.com/lucasrodcosta/nginx-studies
- Owner: lucasrodcosta
- License: gpl-3.0
- Created: 2023-01-17T18:34:09.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T21:07:06.000Z (almost 2 years ago)
- Last Synced: 2024-12-14T23:30:38.922Z (10 days ago)
- Topics: nginx
- Language: Makefile
- Homepage:
- Size: 1.24 MB
- Stars: 13
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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.- [sendfile](https://github.com/lucasrodcosta/nginx-studies/tree/main/sendfile)
- [tcp_nopush](https://github.com/lucasrodcosta/nginx-studies/tree/main/tcp_nopush)
- TODO: kTLS
- TODO: http/2
- TODO: http/3## Requirements
All studies requires an OpenResty docker image with debug flag and [strace](https://strace.io/).
1. Clone the [docker-openresty repo](https://hub.docker.com/r/openresty/openresty)
2. Add the flag `--with-debug` inside the `RESTY_CONFIG_OPTIONS` in file `alpine/Dockerfile`:
```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`:
```Dockerfile
# Add additional binaries into PATH for convenience
ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/binRUN apk add strace
# Copy nginx configuration files
COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
```4. Build the Nginx:
```bash
docker build -t openresty-with-debug:latest -f alpine/Dockerfile .
```## How to run the images of the studies
1. Run Nginx:
```bash
make run
```2. In another terminal, attach the strace process to Nginx:
```bash
make strace
```3. In another terminal, reload the Nginx:
```bash
make reload
```4. Make the requests. Each study has its own instructions about this step.