Baoyuantop commented on issue #7223:
URL: https://github.com/apache/apisix/issues/7223#issuecomment-4043785872

   This issue stems from a design limitation of the Nginx env directive—it 
doesn't support environment variables with values ​​containing spaces or 
newlines. APISIX directly includes `env NAME=VALUE;` in the generated 
nginx.conf file, and Nginx doesn't provide any quotation/escaping mechanism to 
handle values ​​containing spaces.
   
   Possible Workarounds:
   
   1. Avoid directly injecting certificate content via `${{VAR}}`. Instead, use 
a multi-line YAML string (using the `|` syntax) to inline the certificate 
content in `apisix.yaml`.
   
   2. The hotfix idea provided by @boekkooi-lengoo in the comments: Write only 
the environment variable name (without the value) in `ops.lua` to the `env` 
directive in `nginx.conf` (i.e., `env CCERT;`), allowing nginx to read the 
value from the process environment at runtime.
   
   3. Use an SSL object + `client_cert_id` to indirectly reference the 
certificate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to