Skip to content

Instantly share code, notes, and snippets.

@shmdt
Created February 9, 2018 13:15
Show Gist options
  • Select an option

  • Save shmdt/2ee4f7084828facb0535aef7316641b4 to your computer and use it in GitHub Desktop.

Select an option

Save shmdt/2ee4f7084828facb0535aef7316641b4 to your computer and use it in GitHub Desktop.
Add subdomain to nginx and update with https
sudo certbot --authenticator webroot --installer nginx
select number
add webroot (path/to/app)
sudo service nginx restart
server {
listen 80;
server_name subdomain.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name subdomain.example.com;
root /home/path/to/app;
index index.html index.htm;
ssl_certificate /etc/letsencrypt/live/subdomain.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/subdomain.example.com/privkey.pem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment