-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
33 lines (33 loc) · 1.34 KB
/
deploy.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
APP_NAME='verticals'
DOCKER_ADDRESS='172.50.13.1:8080'
sudo service nginx stop
sudo certbot certonly --standalone -d $APP_NAME.xom9ik.com --staple-ocsp -m xom9ik.code@gmail.com --agree-tos
echo "server {
server_name $APP_NAME.xom9ik.com;
client_max_body_size 10M;
gzip_static on;
gunzip on;
location / {
proxy_pass http://$DOCKER_ADDRESS;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP \$remote_addr;
}
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/$APP_NAME.xom9ik.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/$APP_NAME.xom9ik.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name $APP_NAME.xom9ik.com;
listen 80;
listen [::]:80;
return 301 https://\$host\$request_uri;
}" >> /etc/nginx/sites-enabled/$APP_NAME.conf
sudo service nginx start
sh ./rerun.sh