Skip to content

Instantly share code, notes, and snippets.

@fawkesley
Created December 11, 2017 09:41
Show Gist options
  • Save fawkesley/92d50b919a6fde9e058537cfcb8b75bc to your computer and use it in GitHub Desktop.
Save fawkesley/92d50b919a6fde9e058537cfcb8b75bc to your computer and use it in GitHub Desktop.
Let's Encrypt / nginx / webroot notes

/etc/nginx/sites-enabled/www.paulfurley.com_HTTP :

server {                                                                        
  listen 80;                                                                    
  listen  [::]:80;                                                              
  server_name www.paulfurley.com;                                               
                                                                                
  location /.well-known/acme-challenge/ {                                       
    # For the letsencrypt "webroot" plugin                                      
    # http://letsencrypt.readthedocs.org/en/latest/using.html#webroot           
    #                                                                           
    # $ certbot certonly --webroot -w /etc/letsencrypt/fake-webroot -d www.paulfurley.com --deploy-hook 'service nginx reload'
                                                                                
    root /etc/letsencrypt/fake-webroot;                                         
  }                                                                             
                                                                                
  location / {                                                                  
    # Redirect everything else from HTTP to HTTPS                               
    return 301 https://$host$request_uri;                                       
  }                                                                             
}  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment