Having trouble with DO guide

Hi

I’m following this link from Digital Ocean and I’m getting the error:

(http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://website.com/.well-known/acme-challenge/VWCpznVi2VhXNWw91l8H8OEiMwIaVg8wKpzJZnWUsy8: "<html>

I’m looking in my file structure and I can see .well-known folder. But it’s empty? I’m assuming this is wrong, but not sure how to fix?

it will be empty most of the time except while a challenge is actually being validated. However, the response suggests that your server is not serving the challenge file. Can you check your web server configuration to see if there’s a reason why resources under .well-known won’t be served?

Also, what command are you running to try to get your cert?

Thanks for the reply.

This is the command sudo letsencrypt certonly -a webroot --webroot-path=/var/www/html -d website.com -d www.website.com

(I also tried webroot-path=/home/username/projectname/)

I’m not really sure, I can tell you that I’m running a Django app. It’s actually my first time using Django on a DO server.

I’ve looked at the nginx logs and it states open() "/usr/share/nginx/html/.well-known/acme-challenge/cjcp80wkgbW2qJ9j2llG3LSoWkLY8z0GFfGdMS7lohQ" failed (2: No such file or directory), client: 66.133.109.36, server: website.com, request: "GET /.well-known/acme-challenge/cjcp80wkgbW2qJ9j2llG3LSoWkLY8z0GFfGdMS7lohQ HTTP/1.1", host: "website.com"

So:

  1. /usr/share/nginx/html/ -> this only has a index.html file, that seems to be the nginx index page. So navigating to the www version of my site brings this page up. My site is running everything through gunicorn and configured to load over the non-www version.

I’m running the command from the root directory. I’ve seen this video and he appears to run the command from /home/username/projectname/letsencrypt

My django project structure is like so if it helps:

  • home
    • username
      • projectname
        - .well-known
        - static
        - virtualenv
        - actual django folder (like urls.py etc)

Last thing to mention is if I use the IP address, I get the nginx index.html page, but if I load the domain name I get the django welcome page

UPDATE, I’ve fixed it!

I’ve since revisited my nginx config file and updated the location piece to this:

location /.well-known/ {
    root /home/sammy/myproject;
    allow all;
}

This is just a small difference with the guide when using django! Thanks for the help! I’m sure i’ll have further questions. Will donate tonight once config’d! :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.