TeslaGov / ngx-http-auth-jwt-module

Secure your NGINX locations with JWT
MIT License
308 stars 118 forks source link

set the value of auth_jwt_key implicitely #83

Open farzadam opened 1 year ago

farzadam commented 1 year ago

I try to use this module. when I explicitly set the value for auth_jwt_key it works just fine. But if I set it as: auth_jwt_key $public_key; which is set by a js module beforehand, I get the error: nginx: [error] failed to open public key file is there a way to solve this issue?

JoshMcCullough commented 1 year ago

Sorry for the delay in response. We'll look into allowing variables to be used in the auth_jwt_key directive and others where it might make sense.

AndreMiras commented 8 months ago

If what we want to achieve is retrieving from an environment variable, the Nginx official Docker image runs envsubst as part of the entrypoint. This is a common way for filing config from environment variables. https://github.com/nginxinc/docker-nginx/blob/1.25.2/entrypoint/20-envsubst-on-templates.sh#L31-L74