# hackme.click: a public target for LeanNginx (https://github.com/Beneficial-AI-Foundation/leannginx). # Lines starting with "#SSL" are enabled once the Let's Encrypt certificate exists (deploy.sh). worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; access_log logs/access.log; keepalive_timeout 65; client_max_body_size 64k; gzip on; gzip_types text/css text/plain application/javascript application/json image/svg+xml; gzip_vary on; server { listen 80; listen 443 ssl; ssl_certificate certs/fullchain.pem; ssl_certificate_key certs/privkey.pem; server_name hackme.click; root html; index index.html; add_header X-Content-Type-Options "nosniff"; add_header X-Frame-Options "DENY"; add_header Referrer-Policy "no-referrer"; add_header Content-Security-Policy "default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'"; # The catalog: /?rules, /?about are pre-rendered as /q/.html (the same pattern that # let `GET /?../secret/page` read protected files through stock nginx). location = / { try_files /q/$args.html /index.html; } # Flag 1: behind a password nobody outside has. location /vault/ { auth_basic "vault"; auth_basic_user_file htpasswd-vault; } # Flag 3: a second protected area, next to the catalog's try_files. location /staff/ { auth_basic "staff"; auth_basic_user_file htpasswd-staff; try_files $uri $uri.html =404; } location /files/ { autoindex on; } location /docs/ { alias docs/; } location ~* \.(png|svg|ico)$ { add_header Cache-Control "public, max-age=86400"; } location = /health { default_type text/plain; return 200 "ok\n"; } location /.well-known/acme-challenge/ { default_type text/plain; } error_page 404 /404.html; } }