File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,15 @@ class CoCreateNginx {
22
22
await exec ( 'nginx -v' ) ;
23
23
} catch ( error ) {
24
24
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' ) ;
26
31
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'");
27
34
}
28
35
29
36
let stream = `user www-data;
You can’t perform that action at this time.
0 commit comments