-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-data-bhan.sh
34 lines (29 loc) · 986 Bytes
/
user-data-bhan.sh
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
32
33
34
#!/bin/bash
sudo apt-get update
cd /etc/nginx/sites-available/
sudo rm -rf default
sudo touch default
cat > /etc/nginx/sites-available/default <<EOF
upstream jenkins {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name jenkins.applicationbhan.me;
location / {
proxy_set_header Host \$host:\$server_port;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://jenkins;
}
}
EOF
cd
sudo nginx -t
sudo systemctl restart nginx