Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit b599529

Browse files
committed
add nginx delay
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
1 parent d3e4fe6 commit b599529

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ RUN apt-get update && apt-get install -y \
66
build-essential \
77
libssl-dev \
88
pkg-config \
9-
nginx \
109
openjdk-17-jdk \
1110
git \
1211
curl \
@@ -25,6 +24,15 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
2524
RUN wget https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz -O- | tar xz -C /usr/local
2625
ENV PATH=$PATH:/usr/local/go/bin
2726

27+
# Install Nginx with echo module
28+
RUN wget http://nginx.org/download/nginx-1.11.2.tar.gz && \
29+
tar -xzvf nginx-1.11.2.tar.gz && \
30+
git clone https://github.com/openresty/echo-nginx-module.git && \
31+
cd nginx-1.11.2 && \
32+
./configure --prefix=/opt/nginx --add-module=../echo-nginx-module && \
33+
make -j2 && \
34+
make install
35+
2836
# Nginx configurations
2937
RUN mkdir -p /var/cache/nginx-cache \
3038
/var/lib/nginx/body \

nginx/nginx.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ http {
2020
resolver 8.8.8.8 valid=100s ipv6=off;
2121
listen 3000;
2222
location / {
23+
echo_sleep 0.004; # Delay each request by 4ms
2324
proxy_set_header Host $proxy_host;
2425
proxy_ssl_verify off;
2526
proxy_ssl_server_name on;

0 commit comments

Comments
 (0)