Skip to content

Commit

Permalink
Also update fastcgi_param when changing home dir virtualmin/virtualmi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Mar 21, 2021
1 parent 915f5b5 commit 0d72646
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2484,7 +2484,14 @@ sub feature_set_web_public_html_dir
my $server = &find_domain_server($d);
$server || return &text('redirect_efind', $d->{'dom'});
&lock_all_config_files();
&save_directive($server, "root", [ $d->{'home'}."/".$subdir ]);
my $oldroot = &find_value("root", $server);
my $root = $d->{'home'}."/".$subdir;
&save_directive($server, "root", [ $root ]);
my @fp = &find("fastcgi_param", $server);
foreach my $fp (@fp) {
$fp->{'words'}->[1] =~ s/\Q$oldroot\E/$root/g;
}
&save_directive($server, "fastcgi_param", \@fp);
&flush_config_file_lines();
&unlock_all_config_files();
&virtual_server::register_post_action(\&print_apply_nginx);
Expand Down

0 comments on commit 0d72646

Please sign in to comment.