Skip to content

Commit fa5f136

Browse files
author
Marius Burkard
committed
Update nginx_plugin.inc.php (add port check for proxy)
1 parent 21559a6 commit fa5f136

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

server/plugins-available/nginx_plugin.inc.php

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

15231523
//proxy protocol settings
15241524
if($web_config['vhost_proxy_protocol_enabled'] == "y"){
1525-
$vhost_data['use_proxy_protocol'] = $data['new']['proxy_protocol'];
1526-
$vhost_data['proxy_protocol_http'] = (int)$web_config['vhost_proxy_protocol_http_port'];
1527-
$vhost_data['proxy_protocol_https'] = (int)$web_config['vhost_proxy_protocol_https_port'];
1525+
if((int)$web_config['vhost_proxy_protocol_https_port'] > 0) {
1526+
$vhost_data['use_proxy_protocol'] = $data['new']['proxy_protocol'];
1527+
$vhost_data['proxy_protocol_http'] = (int)$web_config['vhost_proxy_protocol_http_port'];
1528+
$vhost_data['proxy_protocol_https'] = (int)$web_config['vhost_proxy_protocol_https_port'];
1529+
} else {
1530+
$vhost_data['use_proxy_protocol'] = "n";
1531+
}
15281532
}else{
15291533
$vhost_data['use_proxy_protocol'] = "n";
15301534
}

0 commit comments

Comments
 (0)