How to set the Dify tool to use a proxy #6559

Closed
opened 2026-02-21 18:16:19 -05:00 by yindo · 2 comments
Owner

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

Dify version

0.10.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Not all tools have proxy_url or base_url options. Some tools' backend URLs, such as those used by yahoo_finance_analytics, cannot be accessed from certain regions. I would like to know how to configure a unified proxy for these tools, for example, in a .env file.
image
image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @xufengnian on GitHub (Nov 5, 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.10.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Not all tools have proxy_url or base_url options. Some tools' backend URLs, such as those used by yahoo_finance_analytics, cannot be accessed from certain regions. I would like to know how to configure a unified proxy for these tools, for example, in a .env file. ![image](https://github.com/user-attachments/assets/9c80e4fd-93a7-4cad-87bd-e2e1e205f58a) ![image](https://github.com/user-attachments/assets/a3a389a9-2f9b-40f9-ac1f-99125a0ce15d) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 18:16:19 -05:00
yindo closed this issue 2026-02-21 18:16:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 5, 2024):

Hey @xufengnian! 👋 I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's squash those bugs together!

To configure a unified proxy for the Dify tool in a self-hosted Docker environment, you can set the proxy URLs in the .env file. This is particularly useful for tools like yahoo_finance_analytics that may require internet access through a proxy. Here’s how you can do it:

  1. Edit the .env File: Locate the .env file in the docker directory of your Dify setup. If it doesn't exist, you can create one by copying the .env.example file.

  2. Add Proxy Settings: Add the following lines to configure the HTTP and HTTPS proxy settings:

    # HTTP proxy URL
    HTTP_PROXY=http://your_proxy:port
    # HTTPS proxy URL
    HTTPS_PROXY=http://your_proxy:port
    

    Replace your_proxy and port with your actual proxy server details.

  3. Apply Changes: After updating the .env file, restart your Docker containers to apply the changes:

    docker compose down
    docker compose up -d
    

These settings will direct HTTP and HTTPS requests through the specified proxy server, ensuring that tools without specific proxy configurations can still access the internet as needed [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 5, 2024): <!-- Greeting --> Hey @xufengnian! 👋 I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's squash those bugs together! <!-- Answer --> To configure a unified proxy for the Dify tool in a self-hosted Docker environment, you can set the proxy URLs in the `.env` file. This is particularly useful for tools like `yahoo_finance_analytics` that may require internet access through a proxy. Here’s how you can do it: 1. **Edit the `.env` File**: Locate the `.env` file in the `docker` directory of your Dify setup. If it doesn't exist, you can create one by copying the `.env.example` file. 2. **Add Proxy Settings**: Add the following lines to configure the HTTP and HTTPS proxy settings: ```env # HTTP proxy URL HTTP_PROXY=http://your_proxy:port # HTTPS proxy URL HTTPS_PROXY=http://your_proxy:port ``` Replace `your_proxy` and `port` with your actual proxy server details. 3. **Apply Changes**: After updating the `.env` file, restart your Docker containers to apply the changes: ```bash docker compose down docker compose up -d ``` These settings will direct HTTP and HTTPS requests through the specified proxy server, ensuring that tools without specific proxy configurations can still access the internet as needed <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/.env.example)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/README.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@xufengnian commented on GitHub (Nov 5, 2024):

Hey @xufengnian! 👋 I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's squash those bugs together!

To configure a unified proxy for the Dify tool in a self-hosted Docker environment, you can set the proxy URLs in the .env file. This is particularly useful for tools like yahoo_finance_analytics that may require internet access through a proxy. Here’s how you can do it:

  1. Edit the .env File: Locate the .env file in the docker directory of your Dify setup. If it doesn't exist, you can create one by copying the .env.example file.

  2. Add Proxy Settings: Add the following lines to configure the HTTP and HTTPS proxy settings:

    # HTTP proxy URL
    HTTP_PROXY=http://your_proxy:port
    # HTTPS proxy URL
    HTTPS_PROXY=http://your_proxy:port
    

    Replace your_proxy and port with your actual proxy server details.

  3. Apply Changes: After updating the .env file, restart your Docker containers to apply the changes:

    docker compose down
    docker compose up -d
    

These settings will direct HTTP and HTTPS requests through the specified proxy server, ensuring that tools without specific proxy configurations can still access the internet as needed [1][2].

To continue talking to Dosu, mention @dosu.

I try it,but useless

@xufengnian commented on GitHub (Nov 5, 2024): > Hey @xufengnian! 👋 I'm here to help you with any bugs, questions, or contributions you have for Dify. Let's squash those bugs together! > > To configure a unified proxy for the Dify tool in a self-hosted Docker environment, you can set the proxy URLs in the `.env` file. This is particularly useful for tools like `yahoo_finance_analytics` that may require internet access through a proxy. Here’s how you can do it: > > 1. **Edit the `.env` File**: Locate the `.env` file in the `docker` directory of your Dify setup. If it doesn't exist, you can create one by copying the `.env.example` file. > 2. **Add Proxy Settings**: Add the following lines to configure the HTTP and HTTPS proxy settings: > ```dotenv > # HTTP proxy URL > HTTP_PROXY=http://your_proxy:port > # HTTPS proxy URL > HTTPS_PROXY=http://your_proxy:port > ``` > > > > > > > > > > > > Replace `your_proxy` and `port` with your actual proxy server details. > 3. **Apply Changes**: After updating the `.env` file, restart your Docker containers to apply the changes: > ```shell > docker compose down > docker compose up -d > ``` > > These settings will direct HTTP and HTTPS requests through the specified proxy server, ensuring that tools without specific proxy configurations can still access the internet as needed [[1]](https://github.com/langgenius/dify/blob/main/docker/.env.example)[[2]](https://github.com/langgenius/dify/blob/main/docker/README.md). > > _To continue talking to [Dosu](https://dosu.dev), mention @dosu._ I try it,but useless
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6559