laravel / valet

A more enjoyable local development experience for Mac.
https://laravel.com/docs/valet
MIT License
2.49k stars 691 forks source link

nginx: [warn] the "http2_push_preload" directive is obsolete & the "listen ... http2" directive is deprecated #1445

Closed drbyte closed 8 months ago

drbyte commented 10 months ago

Description

Using nginx 1.25.2 (currently the latest version) and calling sudo nginx -t to test the config, reveals deprection/obsolete warnings in configs built from Valet's secure.valet.conf stub file:

nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in ~/.config/valet/Nginx/foo.test:9
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in ~/.config/valet/Nginx/foo.test:15
nginx: the configuration file /opt/homebrew/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /opt/homebrew/etc/nginx/nginx.conf test is successful

partial quote of cli/stubs/secure.valet.conf, starting on line 8: (Lines 9, 10, 15 affected)

server {
    listen 127.0.0.1:443 ssl http2;
    #listen VALET_LOOPBACK:443 ssl http2; # valet loopback
    server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
    root /;
    charset utf-8;
    client_max_body_size 512M;
    http2_push_preload on;

/cc @corneliusio re: http2_push_preload added in #573

Steps To Reproduce

Can also be seen in the output of sudo nginx -t when calling valet diagnose

Upgrade note: NOTE whenever we change the secure.valet.conf stub file, then when you upgrade your Valet version, it will take effect automatically on each new domain you run valet secure on. You can optionally re-secure all your domains by running valet tld test (where test equates to your .test tld in use; substitute accordingly if you're not using Valet's only officially supported TLD of .test)

Diagnosis

👍

OpJePl44tsm4n commented 9 months ago

Had the same problem with reinstalling latest valet and so also latest nginx. made a fix in this pr

driesvints commented 8 months ago

Closing this now that a PR is up. Thanks!