-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jay
authored and
Jay
committed
Jul 7, 2024
1 parent
bc7fc9e
commit d6e51b7
Showing
7 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
httpServer: | ||
port: 8088 | ||
mode: debug # or release | ||
contextPath: / | ||
|
||
storage: | ||
redisHost: localhost:6379 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
httpServer: | ||
port: 8088 | ||
mode: debug # or release | ||
contextPath: /api/ | ||
|
||
storage: | ||
redisHost: localhost:6379 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Check if backend servers are healthy and update NGINX configuration | ||
|
||
BACKENDS=("docker-multi-worker-worker-ts-1" "docker-multi-worker-worker-ts-2" "docker-multi-worker-worker-ts-3") | ||
CONFIG_FILE="/etc/nginx/conf.d/upstream.conf" | ||
TMP_FILE="/tmp/upstream.conf.tmp" | ||
|
||
echo "upstream api_backend {" > $TMP_FILE | ||
for BACKEND in "${BACKENDS[@]}"; do | ||
if curl -s --head http://$BACKEND | grep "200 OK" > /dev/null; then | ||
echo " server $BACKEND;" >> $TMP_FILE | ||
else | ||
echo " # server $BACKEND (down);" >> $TMP_FILE | ||
fi | ||
done | ||
echo "}" >> $TMP_FILE | ||
|
||
mv $TMP_FILE $CONFIG_FILE | ||
nginx -s reload |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
httpServer: | ||
port: 8089 | ||
mode: test | ||
contextPath: / | ||
|
||
storage: | ||
redisHost: ${REDIS_HOST} | ||
|
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