handle deprecated http2_push_preload conf for nginx >= 1.25.1#1451
handle deprecated http2_push_preload conf for nginx >= 1.25.1#1451mattstauffer merged 7 commits intolaravel:masterfrom
Conversation
|
I agree that this is the correct fix. Unfortunately it only works if the Nginx version is 1.25.1 or greater, which is quite new. The changed syntax is not backward-compatible. (Ref: nginx docs )
If someone is using (or is forced to use) an older Nginx version, they will get the following anytime they run @mattstauffer how do you feel about incorporating nginx-version-detection so we can handle version-specific stub file handling? |
|
@drbyte thank you for your response, I was thinking about that. Without a mayor version bump, probably a version check would be needed, since installing Valet requires the latest nginx version by default. I'll take a look and will update the PR. |
|
At least the old syntax is not throwing Fatal errors and preventing Nginx from starting. |
|
@drbyte true but fresh installs will require lates version of nginx so now it's broken as is. my suggestion is to add a check in Site.php to check the nginx version and require I'll make a fix so you can check it. |
| public function buildSecureNginxServer(string $url, string $siteConf = null): string | ||
| { | ||
| if ($siteConf === null) { | ||
| $nginxVersion = ltrim(exec('nginx -v'), 'nginx version: nginx/'); |
There was a problem hiding this comment.
Since ltrim() technically doesn't support passing a "phrase" (it treats it as a bunch of characters, not a phrase), perhaps simply str_replace() might be better?
There was a problem hiding this comment.
@OpJePl44tsm4n perhaps also rework the Title of this PR slightly to incorporate "http2" into it?
Maybe something like "handle deprecated http2_push_preload conf for nginx >= 1.25.1" ?
|
@mattstauffer @driesvints I think this is ready for merge. Of course, feel free to test on your local machine before+after upgrading nginx via |
version to string
|
@drbyte thank you so much for reviews and back-and-forths! Again, apologies for my delay here. @OpJePl44tsm4n thank you for this PR! Testing now, and will merge if it doesn't bonk things for me. |
Updated the config so it will work for fresh installs.
removed http2 and http2_push_preload because they are deprecated in latest Nginx versions.