FPM-NGINX 7.4 & 8.0: unknown directive "http2" in 7.4-fpm-nginx-alpine
Steps To Reproduce
Run docker run --rm -e SSL_MODE="full" serversideup/php:7.4-fpm-nginx-alpine. The directive http2 is not know in this version of nginx and therefore the https server cannot start.
Outcome
What did you expect?
A valid nginx config which can be interpreted by the running nginx.
What happened instead?
The containers cant start because of a recurring nginx error:
nginx: [emerg] unknown directive "http2" in /etc/nginx/site-opts.d/https.conf:3
Affected Docker Images
serversideup/php:7.4-fpm-nginx-alpine, serversideup/php:8.0-fpm-nginx-alpine
Anything else?
This commit did break it: https://github.com/serversideup/docker-php/commit/9999c0967575f66d8dd55f37f025f98885efde9c Reverting it for the few containers worked for me.
🔀 Workaround
- Use Debian based images for now (
serversideup/php:7.4-fpm-nginxorserversideup/php:8.0-fpm-nginx
👉 Potential Cause
The base OS for Alpine for these versions is Alpine Linux v3.16. This operating system reached "end of life" 4 months ago https://endoflife.date/alpine
⚠️ Warning
People who are continuing to use PHP 7.4 or 8.0 should upgrade to a supported version of PHP as soon as possible: https://www.php.net/supported-versions.php
It's issues like this that make it challenging to support a legacy release. Our intention to offer these older versions were to make it easier for a team to containerize their application, then simplify the change to a modern version of PHP.
🗣️ Further discussion
Because the operating system is end of life, I am hesitant to keep shipping it. Should we just remove the alpine variations for 7.4? If they need 7.4, the Debian images still work.
This was fixed in v3.6 since we're now getting NGINX from the official repos now 🥳
Our alpine3.16 images ship with nginx/1.26.1, which has http2 support