With the current implementation, an nginx variable $njs_acme_challenge_dirmust be defined since it is used in the /.well-known/acme-challenge location block, which uses an alias directive to serve content from that directory. It is not possible to use an environment variable for this value.
If we change to use js_content to serve challenge responses, we can eliminate the need for this special configuration variable by using a reasonable default value in the njs code.
With this change, users can still customize the location of this directory either via environment variable or nginx variable, maintaining consistency with the other configuration options.
I have tested this locally as well as on my personal server at https://steinkamp.us/
Proposed changes
With the current implementation, an nginx variable
$njs_acme_challenge_dir
must be defined since it is used in the/.well-known/acme-challenge
location block, which uses analias
directive to serve content from that directory. It is not possible to use an environment variable for this value.If we change to use
js_content
to serve challenge responses, we can eliminate the need for this special configuration variable by using a reasonable default value in the njs code.With this change, users can still customize the location of this directory either via environment variable or nginx variable, maintaining consistency with the other configuration options.
I have tested this locally as well as on my personal server at https://steinkamp.us/