The docker-entrypoint.sh variable in nginx is incorrectly configured #4347

Closed
opened 2026-02-21 18:05:57 -05:00 by yindo · 1 comment
Owner

Originally created by @kanedai on GitHub (Jun 30, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.12

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In docker-entrypoint.sh file, line 3:

if [ "${HTTPS_ENABLED}" = "true" ]; then

${HTTPS_ENABLED} should be NGINX_HTTPS_ENABLED, it due to the default.conf not working with ssl config.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @kanedai on GitHub (Jun 30, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.12 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In docker-entrypoint.sh file, line 3: ``` if [ "${HTTPS_ENABLED}" = "true" ]; then ``` ${HTTPS_ENABLED} should be NGINX_HTTPS_ENABLED, it due to the default.conf not working with ssl config. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:05:57 -05:00
yindo closed this issue 2026-02-21 18:05:57 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 30, 2024):

Hello, @kanedai! 👋 I'm here to help you with any bug reports, questions, or contributions you have for the Dify repository. I'm a bot designed to assist you while you wait for a human maintainer.

To resolve the issue with the docker-entrypoint.sh file, you need to change the variable ${HTTPS_ENABLED} to ${NGINX_HTTPS_ENABLED} on line 3. Here is the corrected script:

#!/bin/bash

if [ "${NGINX_HTTPS_ENABLED}" = "true" ]; then
    # set the HTTPS_CONFIG environment variable to the content of the https.conf.template
    HTTPS_CONFIG=$(envsubst < /etc/nginx/https.conf.template)
    export HTTPS_CONFIG
    # Substitute the HTTPS_CONFIG in the default.conf.template with content from https.conf.template
    envsubst '${HTTPS_CONFIG}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
fi

env_vars=$(printenv | cut -d= -f1 | sed 's/^/$/g' | paste -sd, -)

envsubst "$env_vars" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
envsubst "$env_vars" < /etc/nginx/proxy.conf.template > /etc/nginx/proxy.conf

envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf

# Start Nginx using the default entrypoint
exec nginx -g 'daemon off;'

Additionally, you need to update other references to ${HTTPS_ENABLED} in the docker/.env.example and docker/docker-compose.yaml files to ${NGINX_HTTPS_ENABLED} to ensure consistency and proper functionality [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 30, 2024): <!-- Greeting --> Hello, @kanedai! 👋 I'm here to help you with any bug reports, questions, or contributions you have for the Dify repository. I'm a bot designed to assist you while you wait for a human maintainer. <!-- Answer --> To resolve the issue with the `docker-entrypoint.sh` file, you need to change the variable `${HTTPS_ENABLED}` to `${NGINX_HTTPS_ENABLED}` on line 3. Here is the corrected script: ```sh #!/bin/bash if [ "${NGINX_HTTPS_ENABLED}" = "true" ]; then # set the HTTPS_CONFIG environment variable to the content of the https.conf.template HTTPS_CONFIG=$(envsubst < /etc/nginx/https.conf.template) export HTTPS_CONFIG # Substitute the HTTPS_CONFIG in the default.conf.template with content from https.conf.template envsubst '${HTTPS_CONFIG}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf fi env_vars=$(printenv | cut -d= -f1 | sed 's/^/$/g' | paste -sd, -) envsubst "$env_vars" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf envsubst "$env_vars" < /etc/nginx/proxy.conf.template > /etc/nginx/proxy.conf envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf # Start Nginx using the default entrypoint exec nginx -g 'daemon off;' ``` Additionally, you need to update other references to `${HTTPS_ENABLED}` in the `docker/.env.example` and `docker/docker-compose.yaml` files to `${NGINX_HTTPS_ENABLED}` to ensure consistency and proper functionality <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/nginx/docker-entrypoint.sh)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/.env.example)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4347