Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in [from nginx 1.25.1 onwards] #1593

Closed
xepa opened this issue May 8, 2024 · 8 comments
Labels
enhancement New feature or request skip-changelog

Comments

@xepa
Copy link

xepa commented May 8, 2024

In version 1.25.1 and later http2 directive in listen statement is deprecated, the current method should only change operations if the version of nginx is 1.25.1 or later (older versions MUST retain this method).

For reference please see https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: all
  • Module version:

How to reproduce (e.g Puppet code you use)

nginx::resource::server { 'example.com':
  ssl            => true,
  http2       => true,
  ... and others ...
}

What are you seeing

# MANAGED BY PUPPET
server {
  listen       *:443 ssl http2;
  ... and others ...
}

What behaviour did you expect instead

# MANAGED BY PUPPET
server {
  listen       *:443 ssl;
  http2        on;
  ... and others ...
}

Output log

2024/05/08 12:34:46 [warn] 2465396#2465396: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/sites-enabled/100-sentry.veaplatform.nl_https.conf:4

Any additional information you'd like to impart

@xepa xepa changed the title [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in [from nginx 1.25.1 onwards] May 8, 2024
@TheMeier TheMeier added the enhancement New feature or request label May 8, 2024
@TheMeier
Copy link
Contributor

TheMeier commented May 8, 2024

Hm isn't that already implemented

<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) >= 0 && @http2 -%>
http2 <%= @http2 %>;
<% end -%>

@TheMeier
Copy link
Contributor

TheMeier commented May 8, 2024

I guess the issue is, last release was Jun 26, 2023

@xepa
Copy link
Author

xepa commented May 8, 2024

I was not aware that this was even an option, not sure why my code is even doing this I will investigate .. I will reopen if I can not get this to work ..

@xepa xepa closed this as completed May 8, 2024
@TheMeier
Copy link
Contributor

TheMeier commented May 8, 2024

As I pointed out, that feature is not released :/

@999faryad
Copy link

Problem still occurs in the latest version. also with
http2 => 'on',

@999faryad
Copy link

@xepa since you have not reopened the issue, have you found a workaround / fix?

@kenyon
Copy link
Member

kenyon commented May 26, 2024

@999faryad it was fixed in #1579, but there hasn't been a release containing this yet. You can use the module from git instead of a release.

@xepa
Copy link
Author

xepa commented May 27, 2024

@xepa since you have not reopened the issue, have you found a workaround / fix?

I was using the master ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request skip-changelog
Projects
None yet
Development

No branches or pull requests

4 participants