I have a nginx server (1.10) and I am trying to access a certain location block for letsecnrypt but having no luck. I have modsecurity and pagespeed both included in my compiled nginx.

OS is Ubuntu 16.04 LTS

My error message I get is `An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.

Here is my nginx location block:

location ~* /\.well-known {
  root /work-disk/www;
  try_files $uri $uri/ @other_node; #@other_node is another location block to handle passing requests to my second server that I can no remove
  # access_log off;
  pagespeed off;
  ModSecurityEnabled off;

I have so far checked /var/log/nginx/error.log and /var/log/messages both of which show nothing pointing to anything. The former shows logs about the process and the latter shows a blank file.


Just gave allow all; a try and same error.


You should use simple prefix matching here:

location /.well-known {

You need also make sure that /work-disk/www/.well-known directory exists, because that is where nginx is looking for the resources for requests to /.well-known URI.

  • That does nothing but change the error to a 403 – Josh Kirby Jan 3 at 13:00
  • What does the nginx error.log show for the failed requests? – Tero Kilkanen Jan 3 at 20:01

Zero clue what was wrong but asked a senior coworker for permission to rebuild the VM and got told to use ./certbot-auto certonly -n --webroot -w /work-disk/www -d <mydomain.com> --agree-tos --email <our ssl email>

I am not 100% on why this worked but I think it has to do with the certonly part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.