server {
listen 80;
server_name www.mydomain.org mydomain.org;
rewrite ^/(.*) https://mydomain.org/$1 permanent;
# Do not use a /tmp folder or other users can obtain certificates.
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /etc/letsencrypt/webrootauth;
}
}
to:
server {
listen 80;
server_name www.mydomain.org mydomain.org;
# Do not use a /tmp folder or other users can obtain certificates.
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /etc/letsencrypt/webrootauth;
}
location / {
rewrite ^/(.*) https://mydomain.org/$1 permanent;
}
}
That was it! I had tried simply commenting out the rewrite, but not moving, or putting within a location parameter (is parameter the correct term?).
Requesting root privileges to run certbot...
sudo CERTBOT_AUTO=/opt/letsencrypt/letsencrypt-auto /home/michael/.local/share/letsencrypt/bin/letsencrypt certonly -a webroot --webroot-path=/etc/letsencrypt/webrootauth --renew-by-default --email admin@mydomain.org --text --agree-tos -d mydomain.org
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/mydomain.org/fullchain.pem. Your
cert will expire on 2016-08-12. To obtain a new version of the
certificate in the future, simply run Certbot again.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF:
An error occurred during a connection to mydomain.org. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG
Curl gives me an NGINX 301 page.
Following(?) the nginx docs, I have tried adding the ssl_certificate and ssl_certificate_key parameters within the two 443 server directives, as well as above them, following the 80 server: