Last active
March 10, 2026 03:00
-
-
Save hunzo/3c6cdd2e096e4e431759d5b4b1491b8b to your computer and use it in GitHub Desktop.
simple nginx
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: nginx | |
| ports: | |
| - "80:80" | |
| command: | |
| - /bin/sh | |
| - -c | |
| - | | |
| cat > /etc/nginx/conf.d/default.conf <<'EOF' | |
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| default_type text/plain; | |
| return 200 "nginx running\n"; | |
| } | |
| location /json { | |
| default_type application/json; | |
| return 200 '{"status":"ok","service":"nginx","message":"running"}'; | |
| } | |
| location = /basic_status { | |
| stub_status; | |
| } | |
| } | |
| EOF | |
| exec nginx -g 'daemon off;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment