网站全局设置中增加“XFF中最多地址数”选项

This commit is contained in:
刘祥超
2024-05-06 14:03:09 +08:00
parent ac76839256
commit d1ef6da027
2 changed files with 9 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ func (this *IndexAction) RunPost(params struct {
HttpAllNodeIPShowPage bool
HttpAllEnableServerAddrVariable bool
HttpAllRequestOriginsWithEncodings bool
HttpAllXFFMaxAddresses int
HttpAllDomainAuditingIsOn bool
HttpAllDomainAuditingPrompt string
@@ -219,6 +220,7 @@ func (this *IndexAction) RunPost(params struct {
config.HTTPAll.LnRequestSchedulingMethod = params.HttpAllLnRequestSchedulingMethod
config.HTTPAll.EnableServerAddrVariable = params.HttpAllEnableServerAddrVariable
config.HTTPAll.RequestOriginsWithEncodings = params.HttpAllRequestOriginsWithEncodings
config.HTTPAll.XFFMaxAddresses = params.HttpAllXFFMaxAddresses
// 访问日志
config.HTTPAccessLog.IsOn = params.HttpAccessLogIsOn

View File

@@ -298,6 +298,13 @@
<p class="comment">选中后,表示自动使用<code-label>Accept-Encoding: gzip, ...</code-label>回源,可以用来节约源站流量。</p>
</td>
</tr>
<tr>
<td>XFF中最多地址数</td>
<td>
<input type="text" name="httpAllXFFMaxAddresses" v-model="config.httpAll.xffMaxAddresses"/>
<p class="comment">可以转发的X-Forwarded-For中最多的地址数如果为0表示不限制不要轻易修改此选项避免无法获取真实的客户端地址。</p>
</td>
</tr>
</table>
</div>
<div class="margin"></div>