Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update certbot.rst - fix hitting index.html instead static file #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nykilor
Copy link

@Nykilor Nykilor commented Dec 11, 2024

When using the unit:php8.3 Docker image and certbot if you apply the configuration specified in the documentation nginx tries to serve index.html instead of the specified file for certbot challenges:

"routes": [
{
"match": {
"uri": "/.well-known/acme-challenge/*"
},
"action": {
"share": "/var/www/acme$uri/"
}
},
...

Results in:

nginx-1 | 2024/12/11 11:08:31.859 [debug] 55#58 *15 http static: "/var/www/acme$uri/", index: "index.html" (chroot: "")
nginx-1 | 2024/12/11 11:08:31.859 [debug] 55#58 *15 tstr query: "/var/www/acme$uri/", result: "/var/www/acme/.well-known/acme-challenge/L_rKHzm-7qkPD6pxZoSQx4F2Y87lNCpLJukMmdlmfqI/"
nginx-1 | 2024/12/11 11:08:31.860 [debug] 55#58 *15 open("/var/www/acme/.well-known/acme-challenge/L_rKHzm-7qkPD6pxZoSQx4F2Y87lNCpLJukMmdlmfqI/index.html", 0x800, 0x0): -1 err:2

As oppose to fixed configuration (removed slash at the end of "action" -> "share"):

"routes": [
{
"match": {
"uri": "/.well-known/acme-challenge/*"
},
"action": {
"share": "/var/www/acme$uri"
}
},
...

Results in:

nginx-1 | 2024/12/11 11:02:12.234 [debug] 55#59 *15 http static: "/var/www/acme$uri", index: "index.html" (chroot: "")
nginx-1 | 2024/12/11 11:02:12.234 [debug] 55#59 *15 tstr query: "/var/www/acme$uri", result: "/var/www/acme/.well-known/acme-challenge/L_rKHzm-7qkPD6pxZoSQx4F2Y87lNCpLJukMmdlmfqI"
nginx-1 | 2024/12/11 11:02:12.234 [debug] 55#59 *15 open("/var/www/acme/.well-known/acme-challenge/L_rKHzm-7qkPD6pxZoSQx4F2Y87lNCpLJukMmdlmfqI", 0x800, 0x0): -1 err:2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant