Skip to content

Commit 11d8d91

Browse files
authored
Add use-proxy support to health extra args (#2973)
1 parent 2023f5a commit 11d8d91

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/misc/autopause-autostop/autostop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An option to stop the server after a specified time has been added for niche applications (e.g. billing saving on AWS Fargate). The function is incompatible with the Autopause functionality, as they basically cancel out each other.
44

5-
!!! note
5+
!!! note
66

77
the docker container variables have to be set accordingly (restart policy set to "no") and that the container has to be manually restarted.
88

@@ -25,3 +25,6 @@ The following environment variables define the behavior of auto-stopping:
2525
describes period of the daemonized state machine, that handles the stopping of the server
2626

2727
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
28+
29+
## Proxy Support
30+
If you make use of PROXY Protocol, i.e. through something like HAProxy or Fly.io, you will need to enable it in your variety of server's configuration, and then set the `USES_PROXY_PROTOCOL` envar to `true`. This lets Autostop monitor the server, where it otherwise wouldn't

scripts/start-finalExec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ MC_HEALTH_EXTRA_ARGS=(
227227
--use-server-list-ping
228228
)
229229
" > /data/.mc-health.env
230+
elif isTrue "$USES_PROXY_PROTOCOL"; then
231+
echo "
232+
MC_HEALTH_EXTRA_ARGS=(
233+
--use-proxy
234+
)
235+
" > /data/.mc-health.env
230236
else
231237
rm -f /data/.mc-health.env
232238
fi

0 commit comments

Comments
 (0)