nginx + redirect + lets encrypt = /.well-known/acme-challenge/empty.dir (404)

Discussion in 'General' started by username, Nov 25, 2016.

  1. username

    username New Member

    hello till, hello all, first of all, thanks for your great development and support of ispconfig
    i have a problem with lets encrypt authorization procedure for website what running nginx + subdomain configured
    i think that most types of redirection inside a virtual host, for example created in administration by Redirect Path: /dev.example.com/
    Code:
    # /etc/nginx/sites-available/example.com.vhost
    
    if ($http_host = "dev.example.com") {
      rewrite ^(?!/\b(dev.example.com|stats)\b)/(.*)$ /dev.example.com/$2 ;
    }
    makes unusable this location configuration
    Code:
    # /etc/nginx/sites-available/example.com.vhost
    
    location ~ /\.well-known/acme-challenge/ {
      root /usr/local/ispconfig/interface/acme/;
      index index.html index.htm;
      try_files $uri =404;
    }
    and the final effect is that this subdomain address http(s)://dev.example.com/.well-known/acme-challenge/empty.dir returns 404 not found
    Code:
    # /var/log/letsencrypt/letsencrypt.log
    
    Detail: Invalid response from http://dev.example.com/.well-known/acme-challenge/[hash]
    i think that it is really a problem because redirection for website, subdomain (or maybe aliasdomain) can be set through client/reseller administration = clients/resellers are able to break this authorization procedure for authorized websites
    i found this discussion and i think it is similar to my problem: https://git.ispconfig.org/ispconfig/ispconfig3/issues/4008 - but already closed/solved
    thanks for investigation
     
    Last edited: Nov 25, 2016

Share This Page