Skip to content

Instantly share code, notes, and snippets.

@hunzo
Last active March 10, 2026 03:00
Show Gist options
  • Select an option

  • Save hunzo/3c6cdd2e096e4e431759d5b4b1491b8b to your computer and use it in GitHub Desktop.

Select an option

Save hunzo/3c6cdd2e096e4e431759d5b4b1491b8b to your computer and use it in GitHub Desktop.
simple nginx
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