Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx template not replace correctly in docker compose #15650

Open
5 tasks done
LiuBodong opened this issue Mar 12, 2025 · 1 comment · May be fixed by #15651
Open
5 tasks done

Nginx template not replace correctly in docker compose #15650

LiuBodong opened this issue Mar 12, 2025 · 1 comment · May be fixed by #15651
Labels
🐞 bug Something isn't working

Comments

@LiuBodong
Copy link

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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. cd docker
  2. docker compose up -d
  3. check docker/nginx/conf.d/default.conf

Image

✔️ Expected Behavior

location /e/ {
  proxy_pass http://plugin_daemon:5002;
  proxy_set_header Dify-Hook-Url $scheme://$host$request_uri;
  include proxy.conf;
}

❌ Actual Behavior

location /e/ {
  proxy_pass http://plugin_daemon:5002;
  proxy_set_header Dify-Hook-Url ://;
  include proxy.conf;
}
@dosubot dosubot bot added the 🐞 bug Something isn't working label Mar 12, 2025
Copy link

dosubot bot commented Mar 12, 2025

The issue you're experiencing with the Nginx template not replacing placeholders correctly in the Docker Compose setup might be related to how environment variables or placeholders are processed during the configuration generation.

In the Dify Docker setup, the Nginx configuration is generated using template files and a script (docker-entrypoint.sh) that processes these templates. The placeholders like $scheme, $host, and $request_uri should be replaced by Nginx itself during runtime, not during the template processing. If they are not being replaced correctly, it might be due to a misconfiguration in the template or the way the script is handling the template files.

Here are a few things you can check or try:

  1. Ensure Correct Template Syntax: Verify that the placeholders in your Nginx template files are correctly formatted. They should be written as $scheme, $host, and $request_uri without any additional characters or spaces.

  2. Check Entrypoint Script: Make sure that the docker-entrypoint.sh script is correctly copying and processing the template files. Any errors in this script could lead to incorrect configuration generation.

  3. Environment Variables: Ensure that any environment variables used in the template are correctly set and accessible to the Nginx container.

  4. Nginx Configuration: Double-check the Nginx configuration to ensure that it is set up to handle these variables correctly. The placeholders should be part of the Nginx runtime configuration and not replaced during the template processing.

If these steps do not resolve the issue, you might want to look into the specific logic within the docker-entrypoint.sh script or any related configuration files to ensure they are functioning as expected.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@LiuBodong LiuBodong linked a pull request Mar 12, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant