Skip to content

Instantly share code, notes, and snippets.

@yershalom
Created October 17, 2020 15:32
Show Gist options
  • Save yershalom/f2c4b847d8231f316b3795b14bebee07 to your computer and use it in GitHub Desktop.
Save yershalom/f2c4b847d8231f316b3795b14bebee07 to your computer and use it in GitHub Desktop.
#!/bin/bash
apt-get update
apt-get install nginx
cat << EOF > /etc/nginx/sites-available/azure
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name azure-test-vm.southcentralus.cloudapp.azure.com; // CHANGE ME - you server dns
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
}
EOF
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/azure /etc/nginx/sites-enabled/azure
service nginx reload
# Let's encrypt installation
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-nginx
certbot --nginx
service nginx reload
# Change the ssl details
Go to /etc/nginx/nginx.conf and change ssl_protocols like this:
ssl_protocols TLSv1.2;
And ssl_ciphers like this:
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment