Skip to content

Commit

Permalink
Fix proxy_pass
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 14, 2024
1 parent 261677f commit 427b4f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/executor/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class NginxExecutor {
} else if (/^http:\/\/(10|127)\.\d+\.\d+\.\d+:\d+(\$\d+|\/.+)?$/) {
node._add(key, config[key]);
}
node._add(key, path.join(`/home/${info.user}`, config[key]));
} else {
node._add(key, config[key]);
}
Expand Down Expand Up @@ -147,6 +146,13 @@ class NginxExecutor {
info.config.index = info.config.index || "index.html index.php";
delete info.config.root;
delete info.config.alias;
if (info.config?.proxy_pass) {
if (!info.config.locations || info.config.locations.length == 0) {
info.config.locations = [{ match: '/' }];
}
info.config.locations[0].proxy_pass = info.config.proxy_pass;
delete info.config?.proxy_pass;
}
expandLocation(node, info.config);
}
extractInfo(node, domain) {
Expand Down

0 comments on commit 427b4f5

Please sign in to comment.