-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloud-init-github.txt
More file actions
31 lines (31 loc) · 917 Bytes
/
cloud-init-github.txt
File metadata and controls
31 lines (31 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#cloud-config
package_upgrade: true
packages:
- nginx
write_files:
- owner: www-data:www-data
path: /etc/nginx/sites-available/default
content: |
server {
listen 80;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
runcmd:
# install Node.js
- 'curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -'
- 'sudo apt-get install -y nodejs'
# clone GitHub Repo into myapp directory
- 'cd /home/azureuser'
- git clone "https://github.com/Mr-Developer2204/Node-Azure-VM.git" myapp
# Install pm2
- 'sudo npm install pm2 -g'
# restart NGINX
- service nginx restart