1Panel-dev / 1Panel-dev/1Panel

[Feature] Directly reference ngx_brotli as a module

Open
#10,653 2 comments 0 reactions 1 assignee View on GitHub

@wanghe-fit2cloud is already working on this.

Since Oct 15, 2025.

type: optimization
Dominant language
Go
Stars
37k
Forks
3.4k
Avg merge
9h 16m
Merged PRs (30d)
105

Description

1Panel Version

2.0.11

Please describe your needs or suggestions for improvements

当前逻辑

在当前版本的1Panel中,OpenResty使用brotli需要首先在“网站-设置-模块”中勾选 ngx_brotli ,然后再点击构建按钮进行完整的静态编译。
整个过程需要消耗大量的时间,特别是在性能不充分的VPS场景下。用户在每次更新版本时都要进行相同的编译操作,成本过高,且存在失败风险。

Please describe the solution you suggest

建议逻辑

由于使用Docker进行部署,因此可以完全以动态模块方式进行编译或者直接引用。
由于仅存在架构区别(X86&ARM),因此同版本OpenResty下可以依赖相同的模块文件。
将“make modules”过程提前到团队发布Docker镜像时,预先编译好可用的模块文件(编译过程正常小于30秒,可完全自动化),然后用户选择启用模块时直接下载对应的模块文件(upx或zip压缩后小于50k),同时修改对应的nginx配置文件完成启用。

对于其他模块:
ngx_http_dav_module
ngx_http_geoip2_module
也可使用动态模块方式进行引用,可考虑内置白名单,在用户添加不存在于此名单中模块时降级为静态编译方式。

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.