diff --git a/bin/start-nginx b/bin/start-nginx index dbf19062..828070ce 100755 --- a/bin/start-nginx +++ b/bin/start-nginx @@ -54,6 +54,14 @@ fi # Start nginx ( + #Test config before actually launching nginx + echo 'buildpack=nginx at=nginx-test-config' + bin/nginx -t -c config/nginx.conf + if [[ $? -ne 0 ]]; then + echo 'nginx-test-config' >$psmgr; + exit 1 + fi + # We expect nginx to run in foreground. # We also expect a socket to be at /tmp/nginx.socket. echo 'buildpack=nginx at=nginx-start' diff --git a/bin/start-nginx-debug b/bin/start-nginx-debug index 8a6b0912..a5db55b8 100755 --- a/bin/start-nginx-debug +++ b/bin/start-nginx-debug @@ -54,6 +54,14 @@ fi # Start nginx ( + #Test config before actually launching nginx + echo 'buildpack=nginx at=nginx-test-config' + bin/nginx-debug -t -c config/nginx.conf + if [[ $? -ne 0 ]]; then + echo 'nginx-test-config' >$psmgr; + exit 1 + fi + # We expect nginx to run in foreground. # We also expect a socket to be at /tmp/nginx.socket. echo 'buildpack=nginx at=nginx-start' diff --git a/bin/start-nginx-solo b/bin/start-nginx-solo index f8eccd99..d8f88e06 100755 --- a/bin/start-nginx-solo +++ b/bin/start-nginx-solo @@ -30,6 +30,14 @@ echo 'buildpack=nginx at=logs-initialized' # Start nginx ( + #Test config before actually launching nginx + echo 'buildpack=nginx at=nginx-test-config' + bin/nginx -t -c config/nginx.conf + if [[ $? -ne 0 ]]; then + echo 'nginx -t' >$psmgr; + exit 1 + fi + #We expect nginx to run in foreground. #We also expect a socket to be at /tmp/nginx.socket. echo 'buildpack=nginx at=nginx-start' diff --git a/changelog.md b/changelog.md index 9ec61495..255e6ab3 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5] - 2020-05-06 +### Added +- [all] add `nginx -t` before starting nginx + ## [1.4] - 2020-05-05 ### Added - [all] add nginx-debug binary