Skip to content

Instantly share code, notes, and snippets.

@Eduard-gan
Created January 4, 2018 10:25
Show Gist options
  • Save Eduard-gan/b8fa6e2194a6dbce7f982685f88a892c to your computer and use it in GitHub Desktop.
Save Eduard-gan/b8fa6e2194a6dbce7f982685f88a892c to your computer and use it in GitHub Desktop.
Let's Encrypt cert renew in web root mode
### Full path: /etc/nginx/sites-enabled/novk.tk
upstream uWSGI {
server 127.0.0.1:8000;
}
server {
listen 80;
server_name novk.tk;
rewrite ^ https://novk.tk$request_uri? permanent;
# rewrite ^ https://mysite.com$uri permanent; # also works
}
server {
listen 443;
ssl on;
ssl_certificate /etc/letsencrypt/live/novk.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/novk.tk/privkey.pem;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
server_name novk.tk;
charset utf-8;
location /static {
alias /var/www/env/novk/static;
}
location / {
uwsgi_pass uWSGI;
include /var/www/env/novk/uwsgi/parameters.conf;
}
###
### Uncomment these lines below and run: certbot renew
###
# WEBROOT REWUITED WITH COMMAND: certbot certonly --webroot -w /var/www/html -d novk.tk
#location /.well-known {
# root /var/www/html;
#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment