Skip to content

Conversation

HynoR
Copy link
Contributor

@HynoR HynoR commented Aug 12, 2025

What this PR does / why we need it?

迁移默认根配置的里的proxy setting到对应的应用部署块中。
这段配置理应在应用部署的根location反代中,而不是在server中,虽然对静态网站或者其他站点模式不会产生影响,但容易与其他用户配置混淆或者造成误解。

后期感觉 server 块应该只放基本配置和部分安全规则,对于实际的反向代理或者路径配置,根据不同站点模式用单独的conf文件配置然后在server 里 include 可能结构会更明确。

Migrate the default root configuration’s proxy settings to the corresponding application deployment block.
These settings should be placed in the root location block of the application’s reverse proxy, rather than in the server block. Although they have no effect on static websites or other site modes, keeping them in the server block can easily cause confusion or misunderstandings with other user configurations.

Going forward, the server block should ideally only contain basic configurations and certain security rules. Actual reverse proxy or path-specific configurations should be placed in separate .conf files according to different site modes, and then included in the server block to make the structure clearer.

Test

Before: Current config in App Deployment
image

After: Config of this version in App Deployment
image

After: Config of this version in Static Website
image

Summary of your change

  • Simplify agent/cmd/server/nginx_conf/website_default.conf
  • Migrate Ambiguous Proxy Setting to Right Place
  • Added AppendDirectives method to Block for variadic directive appending.
  • Replaced multiple block.Directives = append(...) statements with block.AppendDirectives(...) calls across affected methods.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

Copy link

f2c-ci-robot bot commented Aug 12, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

f2c-ci-robot bot commented Aug 12, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wanghe-fit2cloud for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zhengkunwang223
Copy link
Member

感谢你的贡献 是否测试过 开关网站呢?

@HynoR
Copy link
Contributor Author

HynoR commented Aug 12, 2025

测了自己编译的分支,启用和禁用没问题,网站打开也是正常的。除了这一段修改的,其余配置基本上和原本都一致。

@zhengkunwang223 zhengkunwang223 merged commit c9d4e2a into 1Panel-dev:dev-v2 Aug 13, 2025
0 of 3 checks passed
@HynoR HynoR deleted the fix/ng3 branch August 26, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants