diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index 0ba3638a0a06de1f9cd3e914f8a1c44ec569a2ae..9282cb4bd2147a20a3eebc438990ce79479a16b5 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -301,3 +301,6 @@ $wb['content_filter_txt'] = 'Content Filter'; $wb['rspamd_url_txt'] = 'Rspamd URL'; $wb['rspamd_user_txt'] = 'Rspamd User'; $wb['rspamd_password_txt'] = 'Rspamd Password'; +$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol'; +$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port'; +$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port'; diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master index e45226d943be5589831478aa93710ccfec66ebcc..4487e4e4506dfb224e99de4dc607eb0d4cb188b9 100644 --- a/server/conf/nginx_vhost.conf.master +++ b/server/conf/nginx_vhost.conf.master @@ -1,6 +1,6 @@ server { listen <tmpl_var name='ip_address'>:<tmpl_var name='http_port'>; -<tmpl_if name='proxy_protocol' op='==' value='y'> +<tmpl_if name='use_proxy_protocol' op='==' value='y'> <tmpl_if name='proxy_protocol_http' op='>' value='0'> listen <tmpl_var name='ip_address'>:<tmpl_var name='proxy_protocol_http'> proxy_protocol; </tmpl_if> @@ -13,7 +13,7 @@ server { </tmpl_if> <tmpl_if name='ssl_enabled'> 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}; -<tmpl_if name='proxy_protocol' op='==' value='y'> +<tmpl_if name='use_proxy_protocol' op='==' value='y'> <tmpl_if name='proxy_protocol_https' op='>' value='0'> listen <tmpl_var name='ip_address'>:<tmpl_var name='proxy_protocol_https'> ssl proxy_protocol; </tmpl_if> diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 47d3cef5b1a35ea92cb61aa27732924b26f2a53f..ab6cebe4d0db664536d11b4724dc6b916969d9b2 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -12,8 +12,7 @@ <tmpl_loop name='vhosts'> <VirtualHost {tmpl_var name='ip_address'}:{tmpl_var name='port'}> - -<tmpl_if name='proxy_protocol' op='==' value='y'> +<tmpl_if name='use_proxy_protocol' op='==' value='y'> <tmpl_if name='apache_version' op='>=' value='2.4.30' format='version'> <IfModule mod_remoteip.c> RemoteIPProxyProtocol On diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index f0da9e62e066d7944dcb1bd027f3ecd5268f9319..5e80be9740338a8191bf192a3b04330bc04f990d 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1680,7 +1680,7 @@ class apache2_plugin { if($web_config['vhost_proxy_protocol_enabled'] == 'y' && $data['new']['proxy_protocol'] == 'y'){ if((int)$web_config['vhost_proxy_protocol_http_port'] > 0) { $tmp_vhost_arr['port'] = (int)$web_config['vhost_proxy_protocol_http_port']; - $tmp_vhost_arr['proxy_protocol'] = $data['new']['proxy_protocol']; + $tmp_vhost_arr['use_proxy_protocol'] = $data['new']['proxy_protocol']; $vhosts[] = $tmp_vhost_arr; } } @@ -1704,7 +1704,7 @@ class apache2_plugin { if($web_config['vhost_proxy_protocol_enabled'] == 'y' && $data['new']['proxy_protocol'] == 'y'){ if((int)$web_config['vhost_proxy_protocol_https_port'] > 0) { $tmp_vhost_arr['port'] = (int)$web_config['vhost_proxy_protocol_https_port']; - $tmp_vhost_arr['proxy_protocol'] = $data['new']['proxy_protocol']; + $tmp_vhost_arr['use_proxy_protocol'] = $data['new']['proxy_protocol']; $vhosts[] = $tmp_vhost_arr; } } diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 79cb017161b5def198ee69abc170ebe5ff2bbd33..ef9300e5dc5bc58db805e3fa274d3976df47c6fb 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1522,11 +1522,11 @@ class nginx_plugin { //proxy protocol settings if($web_config['vhost_proxy_protocol_enabled'] == "y"){ - $vhost_data['proxy_protocol'] = $data['new']['proxy_protocol']; + $vhost_data['use_proxy_protocol'] = $data['new']['proxy_protocol']; $vhost_data['proxy_protocol_http'] = (int)$web_config['vhost_proxy_protocol_http_port']; $vhost_data['proxy_protocol_https'] = (int)$web_config['vhost_proxy_protocol_https_port']; }else{ - $vhost_data['proxy_protocol'] = "n"; + $vhost_data['use_proxy_protocol'] = "n"; } // set logging variable