Skip to content

Commit

Permalink
run nginx when at least 1 server is defined
Browse files Browse the repository at this point in the history
to make TAR1090_DISABLE work together with serving prometheus on 9274
using nginx in ultrafeeder

run only 1 nginx worker, more should never be needed
  • Loading branch information
wiedehopf committed May 1, 2024
1 parent 2e06c66 commit 5e2d024
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rootfs/etc/nginx.tar1090/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
user www-data;
worker_processes auto;
worker_processes 1;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
daemon off;
Expand Down
3 changes: 2 additions & 1 deletion rootfs/etc/s6-overlay/scripts/nginx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

source /scripts/common

if chk_enabled "${TAR1090_DISABLE}"; then
if [[ "$(ls /etc/nginx/sites-enabled | wc -l)" == "0" ]]; then
exec sleep infinity
fi


mkdir -p /var/log/nginx

exec s6wrap --quiet --prepend=nginx --timestamps --args /usr/sbin/nginx
7 changes: 7 additions & 0 deletions rootfs/etc/s6-overlay/startup.d/04-tar1090-configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

source /scripts/common


if chk_enabled "${TAR1090_DISABLE}"; then
rm -f /etc/nginx/sites-enabled/tar1090
exit 0
fi


# create symlink so /var/cache/fontconfig is in tmpfs
# as per Wiedehopf - https://discord.com/channels/734090820684349521/1102603003376177172/1203826726023729162
# shellcheck disable=SC2174
Expand Down

0 comments on commit 5e2d024

Please sign in to comment.