-
-
Save shmdt/2ee4f7084828facb0535aef7316641b4 to your computer and use it in GitHub Desktop.
Add subdomain to nginx and update with https
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo certbot --authenticator webroot --installer nginx | |
| select number | |
| add webroot (path/to/app) | |
| sudo service nginx restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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