# Usage: # # Start with: # # sudo /use/local/sbin/nginx -c /path/to/this/nginx.conf # # Tail logs: # # $ sudo tail -f /tmp/access.log /tmp/error.log /tmp/match.log # # Generate load: # # $ cat ./urls.txt | xargs curl -i # # See below for urls.txt example. # # Matches should be in /tmp/match.log with a 200 status. # # Everything else should be in /tmp/access.log with a 404 status. worker_processes 1; http { include /usr/local/etc/nginx/mime.types; default_type application/octet-stream; log_format main '$status $request'; # e.g. "200 GET /foo HTTP/1.1" access_log /tmp/access.log main; error_log /tmp/error.log; server { listen 8888; server_name localhost; location ~ ^/good[0-9]$ { # << regex here access_log /tmp/match.log main; return 200; } location / { return 404; } } }