Skip to content

Commit 21559a6

Browse files
committed
Added Missed patch edit, and correct the vhost loop
Change the name from proxy_protocol to use_proxy_protocol in vhost file due to site level overriding the check tested both on apache2 and nginx with haproxy load balancer on TCP Mode
1 parent eac89bb commit 21559a6

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,6 @@ $wb['content_filter_txt'] = 'Content Filter';
301301
$wb['rspamd_url_txt'] = 'Rspamd URL';
302302
$wb['rspamd_user_txt'] = 'Rspamd User';
303303
$wb['rspamd_password_txt'] = 'Rspamd Password';
304+
$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol';
305+
$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port';
306+
$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port';

server/conf/nginx_vhost.conf.master

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
server {
22
listen <tmpl_var name='ip_address'>:<tmpl_var name='http_port'>;
3-
<tmpl_if name='proxy_protocol' op='==' value='y'>
3+
<tmpl_if name='use_proxy_protocol' op='==' value='y'>
44
<tmpl_if name='proxy_protocol_http' op='>' value='0'>
55
listen <tmpl_var name='ip_address'>:<tmpl_var name='proxy_protocol_http'> proxy_protocol;
66
</tmpl_if>
@@ -13,7 +13,7 @@ server {
1313
</tmpl_if>
1414
<tmpl_if name='ssl_enabled'>
1515
listen <tmpl_var name='ip_address'>:<tmpl_var name='https_port'> ssl{tmpl_if name='enable_http2' op='==' value='y'} http2{/tmpl_if}{tmpl_if name='enable_spdy' op='==' value='y'} spdy{/tmpl_if};
16-
<tmpl_if name='proxy_protocol' op='==' value='y'>
16+
<tmpl_if name='use_proxy_protocol' op='==' value='y'>
1717
<tmpl_if name='proxy_protocol_https' op='>' value='0'>
1818
listen <tmpl_var name='ip_address'>:<tmpl_var name='proxy_protocol_https'> ssl proxy_protocol;
1919
</tmpl_if>

server/conf/vhost.conf.master

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
<tmpl_loop name='vhosts'>
1414
<VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name='port'}>
15-
16-
<tmpl_if name='proxy_protocol' op='==' value='y'>
15+
<tmpl_if name='use_proxy_protocol' op='==' value='y'>
1716
<tmpl_if name='apache_version' op='>=' value='2.4.30' format='version'>
1817
<IfModule mod_remoteip.c>
1918
RemoteIPProxyProtocol On

server/plugins-available/apache2_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ function update($event_name, $data) {
16801680
if($web_config['vhost_proxy_protocol_enabled'] == 'y' && $data['new']['proxy_protocol'] == 'y'){
16811681
if((int)$web_config['vhost_proxy_protocol_http_port'] > 0) {
16821682
$tmp_vhost_arr['port'] = (int)$web_config['vhost_proxy_protocol_http_port'];
1683-
$tmp_vhost_arr['proxy_protocol'] = $data['new']['proxy_protocol'];
1683+
$tmp_vhost_arr['use_proxy_protocol'] = $data['new']['proxy_protocol'];
16841684
$vhosts[] = $tmp_vhost_arr;
16851685
}
16861686
}
@@ -1704,7 +1704,7 @@ function update($event_name, $data) {
17041704
if($web_config['vhost_proxy_protocol_enabled'] == 'y' && $data['new']['proxy_protocol'] == 'y'){
17051705
if((int)$web_config['vhost_proxy_protocol_https_port'] > 0) {
17061706
$tmp_vhost_arr['port'] = (int)$web_config['vhost_proxy_protocol_https_port'];
1707-
$tmp_vhost_arr['proxy_protocol'] = $data['new']['proxy_protocol'];
1707+
$tmp_vhost_arr['use_proxy_protocol'] = $data['new']['proxy_protocol'];
17081708
$vhosts[] = $tmp_vhost_arr;
17091709
}
17101710
}

server/plugins-available/nginx_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,11 +1522,11 @@ function update($event_name, $data) {
15221522

15231523
//proxy protocol settings
15241524
if($web_config['vhost_proxy_protocol_enabled'] == "y"){
1525-
$vhost_data['proxy_protocol'] = $data['new']['proxy_protocol'];
1525+
$vhost_data['use_proxy_protocol'] = $data['new']['proxy_protocol'];
15261526
$vhost_data['proxy_protocol_http'] = (int)$web_config['vhost_proxy_protocol_http_port'];
15271527
$vhost_data['proxy_protocol_https'] = (int)$web_config['vhost_proxy_protocol_https_port'];
15281528
}else{
1529-
$vhost_data['proxy_protocol'] = "n";
1529+
$vhost_data['use_proxy_protocol'] = "n";
15301530
}
15311531

15321532
// set logging variable

0 commit comments

Comments
 (0)