fix: Optimize Nginx configure settings #9962
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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

After: Config of this version in App Deployment

After: Config of this version in Static Website

Summary of your change
agent/cmd/server/nginx_conf/website_default.conf
Please indicate you've done the following: