error_page 403 /localhost/403.html;
error_page 404 /localhost/404.html;
error_page 500 /localhost/500.html;
error_page 502 503 504 /localhost/50x.html;
index index.php index.html index.htm;
try_files $uri $uri/ =404;

location /localhost/ {
  alias /usr/share/nginx/html/;
}

location ^~ /.well-known/acme-challenge/ {
  auth_basic off;
  auth_request off;
  allow all;
  root /usr/share/nginx/html;
  try_files $uri =404;
  break;
}

location ~ /\. {
  deny all;
}
