Skip to content

Commit 0e35151

Browse files
authored
Merge pull request #34 from virtualmin/dev/fpm-socket-distro-based-dir
Fix to consider existing directives in Nginx
2 parents 399882c + 0f4a8ee commit 0e35151

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

virtual_feature.pl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,16 +1186,11 @@ sub feature_get_web_php_mode
11861186
my ($loc) = grep { $_->{'words'}->[0] eq '~' &&
11871187
($_->{'words'}->[1] eq '\.php$' ||
11881188
$_->{'words'}->[1] eq '\.php(/|$)') } @locs;
1189-
my $fpmsock = &virtual_server::get_php_fpm_socket_file($d, 1);
1190-
my $fpmport = $d->{'php_fpm_port'};
11911189
if ($loc) {
11921190
my ($pass) = &find("fastcgi_pass", $loc);
11931191
if ($pass && $pass->{'words'}->[0] =~ /^(localhost|127\.0\.0\.1|unix):(.*)$/) {
1194-
if ($1 eq "unix" && $2 eq $fpmsock) {
1195-
return 'fpm';
1196-
}
1197-
elsif (($1 eq "localhost" || $1 eq "127.0.0.1") &&
1198-
$fpmport && $2 eq $fpmport) {
1192+
if (($1 eq "localhost" || $1 eq "127.0.0.1" || $1 eq "unix") &&
1193+
$2 && $2 !~ /\.sock\/socket/) {
11991194
return 'fpm';
12001195
}
12011196
else {

0 commit comments

Comments
 (0)