Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test nginx config before launching nginx #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bin/start-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions bin/start-nginx-debug
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions bin/start-nginx-solo
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down