Skip to content

Instantly share code, notes, and snippets.

@indapublic
Forked from psd/validate_conf.sh
Created April 29, 2014 09:21
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 indapublic/11395024 to your computer and use it in GitHub Desktop.
Save indapublic/11395024 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# validate nginx config
#
# depends upon a symbolic link from /var/apps/redirector to dist directory
# and a build of nginx which supports real_ip and other extensions
#
# probably best to build a chroot'd tree containing a complete nginx server
# though that's a lot of work to copy in shared libraries, etc
#
mkdir -p tmp
conf=$PWD/tmp/test-nginx.conf
cat > $conf <<-!
http {
include $PWD/dist/configs/*.conf;
}
!
PATH=/usr/sbin:/usr/local/sbin nginx -t -c $conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment