dify icon indicating copy to clipboard operation
dify copied to clipboard

FILES_URL setting is not effective

Open HaiShin opened this issue 2 years ago • 9 comments

Self Checks

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

Dify version

0.6.13

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dify is deployed on kubernetes and FILES_URL:dify.xxx.com is set.(at the same time, dify.xxx.com is the main entrance address of the dify system) However, when I upload a docx document, the path for uploading images is still 127.0.0.1:5000/files/xxxx. This results in the inability to display images normally outside the cluster when answering questions.

✔️ Expected Behavior

The image path prefix should be the same as the FILE_URL setting.

❌ Actual Behavior

FILES_URL setting is not effective,path is 127.0.0.1:5001.

HaiShin avatar Jul 25 '24 09:07 HaiShin

https://github.com/langgenius/dify/blob/5e6fc58db3700214634fb6b43e373c165e5ec32f/api/configs/feature/init.py#L89-L96

@laipz8200

crazywoola avatar Jul 25 '24 09:07 crazywoola

What do you mean by this?

However, when I upload a docx document, the path for uploading images is still 127.0.0.1:5000/files/xxxx. This results in the inability to display images normally outside the cluster when answering questions.

Why did you get an image after uploading an docx document?

crazywoola avatar Jul 25 '24 09:07 crazywoola

Because the docx include image

What do you mean by this?

However, when I upload a docx document, the path for uploading images is still 127.0.0.1:5000/files/xxxx. This results in the inability to display images normally outside the cluster when answering questions.

Why did you get an image after uploading an docx document?

Because the document include some images

HaiShin avatar Jul 25 '24 09:07 HaiShin

~See the PR.~ We use the CONSOLE_API_URL long time ago, so if you want to make things working, you should set the CONSOLE_API_URL and FILES_URL

crazywoola avatar Jul 25 '24 09:07 crazywoola

~See the PR.~ We use the CONSOLE_API_URL long time ago, so if you want to make things working, you should set the CONSOLE_API_URL and FILES_URL

Actually, I have set CONSOLE_API_URL and FILES_URL to the same value, but it still doesn't work. Also, I set these two env in the api's Dockerfile, and once again in the pod.

HaiShin avatar Jul 25 '24 11:07 HaiShin

~See the PR.~ We use the CONSOLE_API_URL long time ago, so if you want to make things working, you should set the CONSOLE_API_URL and FILES_URL

Actually, I have set CONSOLE_API_URL and FILES_URL to the same value, but it still doesn't work. Also, I set these two env in the api's Dockerfile, and once again in the pod.

image I opened the docker env configuration and saw that I had configured these two parameters.

HaiShin avatar Jul 25 '24 11:07 HaiShin

I found that the docker env for web-api and web should have CONSOLE_API_URL set.

HaiShin avatar Jul 29 '24 08:07 HaiShin

mee too problem!!!

luogenhua avatar May 20 '25 07:05 luogenhua

i deploy dify with kubernetes too, the problem is also occurs do you have new solution way ?

luogenhua avatar May 23 '25 08:05 luogenhua