Skip to content

feat: add h2c for http server#8294

Merged
xhofe merged 2 commits intoAlistGo:mainfrom
j2rong4cn:feat-h2c
Apr 12, 2025
Merged

feat: add h2c for http server#8294
xhofe merged 2 commits intoAlistGo:mainfrom
j2rong4cn:feat-h2c

Conversation

@j2rong4cn
Copy link
Copy Markdown
Contributor

@j2rong4cn j2rong4cn commented Apr 4, 2025

为alist的http服务支持HTTP/2 Cleartext (H2C)协议。明文的HTTP/2协议

  • 添加配置选项:scheme > enable_h2c 默认为false

开启后支持nginx的grpc_pass

location / {
  grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  grpc_set_header X-Forwarded-Proto $scheme;
  grpc_set_header Host $http_host;
  grpc_set_header X-Real-IP $remote_addr;
  # grpc_set_header Range $http_range;
  # grpc_set_header If-Range $http_if_range;
  proxy_redirect off;
  grpc_pass 127.0.0.1:5244;
  # the max size of file to upload
  client_max_body_size 20480m;
}

@xhofe xhofe merged commit 4f5cabc into AlistGo:main Apr 12, 2025
12 checks passed
@j2rong4cn j2rong4cn deleted the feat-h2c branch April 12, 2025 09:26
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.

2 participants