I’m using Laravel Forge to host a site on AWS using NGINX 1.15.8 and PHP 7.3.4. The domain is ceto-cms-staging.360water.com, and the DNS A-record is properly registered in Rackspace.
I was able to use Laravel Forge to obtain a LetsEncrypt cert for the domain. It’s correctly set up at the moment.
However, after setting it up, I tried to then add multiple subdomains via the Forge UI, which didn’t work, so when I used the UI to revert back to the one, original subdomain, I got the following error:
ERROR: Challenge is invalid! (returned: invalid) (result: {
"type": "http-01",
"status": "invalid",
"error": {
"type": "urn:ietf:params:acme:error:unauthorized",
"detail": "Invalid response from https://ceto-cms-staging.360water.com/.well-known/acme-challenge/l3jIbrjJVBJ88EVnythOrE7E46D_G3DUL2M21Xz5ReU [18.218.162.107]: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e404 Not Found\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e404 Not Found\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx/1.15.8\u003c/ce\"",
"status": 403
},
"url": "https://acme-v02.api.letsencrypt.org/acme/challenge/9YtzdPXLm9QuwCsrk2a9yMiMwsfq7razwadQHOJCvzI/15301925435",
"token": "l3jIbrjJVBJ88EVnythOrE7E46D_G3DUL2M21Xz5ReU",
"validationRecord": [
{
"url": "http://ceto-cms-staging.360water.com/.well-known/acme-challenge/l3jIbrjJVBJ88EVnythOrE7E46D_G3DUL2M21Xz5ReU",
"hostname": "ceto-cms-staging.360water.com",
"port": "80",
"addressesResolved": [
"18.218.162.107"
],
"addressUsed": "18.218.162.107"
},
{
"url": "https://ceto-cms-staging.360water.com/.well-known/acme-challenge/l3jIbrjJVBJ88EVnythOrE7E46D_G3DUL2M21Xz5ReU",
"hostname": "ceto-cms-staging.360water.com",
"port": "443",
"addressesResolved": [
"18.218.162.107"
],
"addressUsed": "18.218.162.107"
}
]
})
I SSH’ed into the server and created a .well-known directory under the site-root/public directory, and I then created an acme-challenge directory within that .well-known directory.
All the permissions seem fine, and if I create a test.txt in the .well-known directory, I can properly access it from the following URL:
https://ceto-cms-staging.360water.com/.well-known/test.txt
However, if I create the same test.txt file in the acme-challenge directory and try to access it, I get a 404 Not Found.
Just for testing purposes, I created an acmechallenge directory (no hyphen) under the .well-known directory and placed a test.txt file in there and I was able to access the file just fine.
Lastly, I have confirmed that the file and directory permissions for all of these directories are the same.
What could possibly be causing this issue and what are some possible things I could do to fix the problem? Thank you.