The docker-entrypoint.sh variable in nginx is incorrectly configured
kanedai opened this issue · comments
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
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].