Last active
October 15, 2025 13:30
-
-
Save pastuhov/2d3ce915903f36be0b35eddbef2bb866 to your computer and use it in GitHub Desktop.
Simple mock web server with a delayed response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| nginx: | |
| image: openresty/openresty:alpine | |
| ports: | |
| - "8080:80" | |
| volumes: | |
| - ./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| worker_processes 1; | |
| events { | |
| worker_connections 100; | |
| } | |
| http { | |
| server { | |
| listen 80; | |
| server_name _; | |
| location = /one { | |
| echo_sleep 1; | |
| echo '{"url":"one","status":"ok"}'; | |
| add_header Content-Type application/json; | |
| } | |
| location = /two { | |
| echo_sleep 2; | |
| echo '{"url":"two","status":"ok"}'; | |
| add_header Content-Type application/json; | |
| } | |
| location = /three { | |
| echo_sleep 3; | |
| echo '{"url":"three","status":"ok"}'; | |
| add_header Content-Type application/json; | |
| } | |
| location = / { | |
| return 200 "nginx up"; | |
| add_header Content-Type text/plain; | |
| } | |
| # healthcheck | |
| location = /health { | |
| return 200 "ok"; | |
| add_header Content-Type text/plain; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment