A
A
account-42017-03-12 17:57:58
Nginx
account-4, 2017-03-12 17:57:58

Problem with .well-known: The client lacks sufficient authorization?

Install SSL Letsencrypt. VPS, nginx, node.js application. The domain is connected.
File /etc/nginx/sites-available/default:

server {
    listen 80;

    server_name мойсайт.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
    }

    location ~ /.well-known {
                allow all;
    }
}

When executing the command
sudo letsencrypt certonly -a webroot --webroot-path=/home/ubuntu/папка-с-node -d example.com -d www.example.com
throws an error
urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://мойсайт/.well-known/acme-challenge/eALeSHOVkIaPXeeBwi1nlSOAG5Lt328xWcx2zShgRYU: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-03-12
@account-4

specify root for location ~ /.well-known {
and in general it is better to replace it withlocation /.well-known {

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question