Skip to content

Instantly share code, notes, and snippets.

@tvon
Last active February 21, 2016 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvon/b825eb07602824cad125 to your computer and use it in GitHub Desktop.
Save tvon/b825eb07602824cad125 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
NGINX=/usr/sbin/nginx
DIRECTIVES="worker_processes 1; pid /var/run/nginx-${USER}.pid; error_log /dev/null;"
# nginx attempts to write to the default logfile location despite the passed directive, so grep those errors out
# (note that I may just be doing something stupid and not properly setting the directive)
$NGINX -t -c $1 -g "$DIRECTIVES" 2>&1 | grep -v '^nginx: '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment