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

change: use apisix.enable_http2 to enable HTTP/2 in APISIX #11032

Merged
merged 6 commits into from
Mar 15, 2024
Merged

Conversation

zll600
Copy link
Contributor

@zll600 zll600 commented Mar 13, 2024

Description

This PR is a Breaking Change.

in #10887, I upgrade openresty-1.25.3.1 for APISIX. There is a deprecation in nginx. The http2 parameter in listen directive is deprecated.

The parameter is deprecated, the http2 directive should be used instead.

In #10887, in order to maintain backward compatibility, I did not modify the method of enable http2 in APISIX. But this will bring a breaking change to users.

for example.
config.yaml

apisix:
  node_listen:
    - ip: 127.0.0.1
      port: 9081
      enable_http2: true  # enable HTTP/2 for 127.0.0.1:9081
    - ip: 127.0.0.2
      port: 9082
      enable_http2: false # disable HTTP/2 for 127.0.0.1:9082

generated nginx.conf which 127.0.0.1:9081 and 127.0.0.2:9082 both can establish HTTP/2 connection. This scenario is not what user want.

    server {
        http2 on;
        listen 127.0.0.1:9081 default_server reuseport;
        listen 127.0.0.2:9082 default_server reuseport;

So I want to make a breaking change for APISIX. Only support apisix.enable_http2. eg.

apisix:
  node_listen:
    - ip: 127.0.0.1
      port: 9081
    - ip: 127.0.0.2
      port: 9082
enable_http2: true # the new way to enable HTTP/2

it will generate following nginx.conf which 127.0.0.1:9081 and 127.0.0.2:9082 both can establish HTTP/2 connection.

    server {
        http2 on;
        listen 127.0.0.1:9081 default_server reuseport;
        listen 127.0.0.2:9082 default_server reuseport;

The original method will no longer be supported. If you still use original way in config.yaml, APISIX will report an error to you.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@zll600 zll600 changed the title chore(http2): do not support enable_http2 in apisix.node_listen and a… chore: use apisix.enable_http2 to enable HTTP/2 in APISIX Mar 13, 2024
@zll600 zll600 marked this pull request as ready for review March 13, 2024 10:02
Copy link
Member

@moonming moonming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add break changes in https://github.com/apache/apisix/blob/master/CHANGELOG.md, you can add a new section next release version

apisix/cli/schema.lua Show resolved Hide resolved
@zll600
Copy link
Contributor Author

zll600 commented Mar 14, 2024

please add break changes in https://github.com/apache/apisix/blob/master/CHANGELOG.md, you can add a new section next release version

resolved by 96fd588. PTAL

@zll600 zll600 requested a review from moonming March 14, 2024 07:40
apisix/cli/ops.lua Outdated Show resolved Hide resolved
apisix/cli/ops.lua Outdated Show resolved Hide resolved
@zll600 zll600 requested a review from moonming March 14, 2024 08:04
@monkeyDluffy6017 monkeyDluffy6017 changed the title chore: use apisix.enable_http2 to enable HTTP/2 in APISIX change: use apisix.enable_http2 to enable HTTP/2 in APISIX Mar 14, 2024
@monkeyDluffy6017 monkeyDluffy6017 merged commit a8573f7 into apache:master Mar 15, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants