Add support for HEALTHCHECK_URL environment variable
#410
jozefrebjak
started this conversation in
General
Replies: 2 comments
-
|
Hi @jozefrebjak, thanks for reaching out. I'm not sure I fully understand your point, but my Docker images don't have a default HEALTHCHECK configured (except the FrankenPHP variants). So I'm not sure where this issue is coming from. If it's related to #360, please try setting the environment variable |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Btw, the internal healthcheck script uses the If this implementation matches what you're looking for, try using that variable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Add support for a
HEALTHCHECK_URLenvironment variable to allow customizing the health check endpoint without overriding the entireHEALTHCHECKinstruction.Problem
When running PHP applications with secure cookie configurations in production, the default health check fails.
Why this happens
Production applications commonly use secure cookies:
__Host-or__Secure-cookie prefixesSecureflag set totrueSameSite=StrictorSameSite=LaxThe internal health checker correctly uses plain HTTP (
http://127.0.0.1/)When the application tries to set a secure cookie over HTTP, it throws an exception
Example error
Fatal error: Uncaught SecurityException: Attempted to send a secure cookie over a non-secure connection.
This affects all major PHP frameworks when configured for production security:
Config\Cookie::$secure = trueSESSION_SECURE_COOKIE=trueframework.session.cookie_secure: trueCurrent workaround
Users must override the entire
HEALTHCHECKin their Dockerfile:This works but:
Proposed solution
Add support for a HEALTHCHECK_URL environment variable:
Beta Was this translation helpful? Give feedback.
All reactions