Skip to content

Commit 2aa49b1

Browse files
committed
fix: download the official and current nginx reposiitory
1 parent c96c1ec commit 2aa49b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ class CoCreateNginx {
2222
await exec('nginx -v');
2323
} catch (error) {
2424
console.log('Nginx not found, installing...');
25-
await exec('sudo apt-get update && sudo apt-get install -y nginx');
25+
// Add Nginx repository
26+
await exec('echo "deb http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" | sudo tee /etc/apt/sources.list.d/nginx.list');
27+
await exec('echo "deb-src http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" | sudo tee -a /etc/apt/sources.list.d/nginx.list');
28+
await exec('curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -');
29+
await exec('sudo apt-get update');
30+
await exec('sudo apt-get install -y nginx');
2631
await exec("sudo ufw allow 'Nginx Full'");
32+
// await exec('sudo apt-get update && sudo apt-get install -y nginx');
33+
// await exec("sudo ufw allow 'Nginx Full'");
2734
}
2835

2936
let stream = `user www-data;

0 commit comments

Comments
 (0)