-
-
Save wpsmithtwc/ab6a25f745093e23c275 to your computer and use it in GitHub Desktop.
use nginx to validate config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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