blocked by SSRF protection #21831

Closed
opened 2026-02-21 20:14:30 -05:00 by yindo · 1 comment
Owner

Originally created by @xiaolv3366 on GitHub (Jan 21, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Access to 'http://172.17.0.1/v1/datasets/050c0969-0ccb-4b5b-885f-3852143de8cd/document/create-by-file' was blocked by SSRF protection. The URL may point to a private or local network address.

✔️ Expected Behavior

can access 172.17.0.1

Actual Behavior

No response

Originally created by @xiaolv3366 on GitHub (Jan 21, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Access to 'http://172.17.0.1/v1/datasets/050c0969-0ccb-4b5b-885f-3852143de8cd/document/create-by-file' was blocked by SSRF protection. The URL may point to a private or local network address. ### ✔️ Expected Behavior can access 172.17.0.1 ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:14:30 -05:00
yindo closed this issue 2026-02-21 20:14:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 21, 2026):

Hi @xiaolv3366! I'm Dosu and I’m helping the dify team.

Access to 172.17.0.1 is blocked because Dify’s SSRF protection routes all HTTP requests through a Squid proxy, which by default denies access to local/private network addresses for security reasons. This is enforced by the Squid proxy configuration, not by a user-facing setting in Dify itself details.

To allow access to 172.17.0.1, you can edit docker/ssrf_proxy/squid.conf.template in your Dify installation. Add http_access allow localnet before the http_access deny all line. If 172.17.0.1 is not already included in the acl localnet src directives, add it there as well. Make sure the port you need is included in the acl Safe_ports or acl SSL_ports lines. After editing, restart the ssrf_proxy container for changes to take effect example and discussion.

Alternatively, you can bypass the SSRF proxy for specific hosts by setting the NO_PROXY environment variable (e.g., NO_PROXY=172.17.0.1) in your API container’s environment. This routes requests directly and avoids proxy restrictions workaround reference.

Relaxing SSRF protection increases your security risk—only do this in trusted environments and revert when not needed. If access is still blocked, check /var/log/squid/access.log inside the ssrf_proxy container for details, and test connectivity with curl from inside the container.

More details and examples are available in this discussion and related issues.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 21, 2026): <!-- Greeting --> Hi @xiaolv3366! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Access to 172.17.0.1 is blocked because Dify’s SSRF protection routes all HTTP requests through a Squid proxy, which by default denies access to local/private network addresses for security reasons. This is enforced by the Squid proxy configuration, not by a user-facing setting in Dify itself [details](https://github.com/langgenius/dify/issues/1542). To allow access to 172.17.0.1, you can edit `docker/ssrf_proxy/squid.conf.template` in your Dify installation. Add `http_access allow localnet` before the `http_access deny all` line. If 172.17.0.1 is not already included in the `acl localnet src` directives, add it there as well. Make sure the port you need is included in the `acl Safe_ports` or `acl SSL_ports` lines. After editing, restart the `ssrf_proxy` container for changes to take effect [example and discussion](https://github.com/langgenius/dify/discussions/27890). Alternatively, you can bypass the SSRF proxy for specific hosts by setting the `NO_PROXY` environment variable (e.g., `NO_PROXY=172.17.0.1`) in your API container’s environment. This routes requests directly and avoids proxy restrictions [workaround reference](https://github.com/langgenius/dify/issues/29792). Relaxing SSRF protection increases your security risk—only do this in trusted environments and revert when not needed. If access is still blocked, check `/var/log/squid/access.log` inside the `ssrf_proxy` container for details, and test connectivity with `curl` from inside the container. More details and examples are available in [this discussion](https://github.com/langgenius/dify/discussions/27890) and [related issues](https://github.com/langgenius/dify/issues/28691). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1739875e-7a3d-4220-baa0-0dc5bbde1c09?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Access%20to%20172.17.0.1%20is%20blocked%20because%20Dify%E2%80%99s%20SSRF%20protection%20routes%20all%20HTTP%20requests%20through%20a%20Squid%20proxy%2C%20which%20by%20default%20denies%20access%20to%20local/private%20network%20addresses%20for%20security%20reasons.%20This%20is%20enforced%20by%20the%20Squid%20proxy%20configuration%2C%20not%20by%20a%20user-facing%20setting%20in%20Dify%20itself%C2%A0%5Bdetails%5D%28https%3A//github.com/langgenius/dify/issues/1542%29.%0A%0ATo%20allow%20access%20to%20172.17.0.1%2C%20you%20can%20edit%20%60docker/ssrf_proxy/squid.conf.template%60%20in%20your%20Dify%20installation.%20Add%20%60http_access%20allow%20localnet%60%20before%20the%20%60http_access%20deny%20all%60%20line.%20If%20172.17.0.1%20is%20not%20already%20included%20in%20the%20%60acl%20localnet%20src%60%20directives%2C%20add%20it%20there%20as%20well.%20Make%20sure%20the%20port%20you%20need%20is%20included%20in%20the%20%60acl%20Safe_ports%60%20or%20%60acl%20SSL_ports%60%20lines.%20After%20editing%2C%20restart%20the%20%60ssrf_proxy%60%20container%20for%20changes%20to%20take%20effect%C2%A0%5Bexample%20and%20discussion%5D%28https%3A//github.com/langgenius/dify/discussions/27890%29.%0A%0AAlternatively%2C%20you%20can%20bypass%20the%20SSRF%20proxy%20for%20specific%20hosts%20by%20setting%20the%20%60NO_PROXY%60%20environment%20variable%20%28e.g.%2C%20%60NO_PROXY%3D172.17.0.1%60%29%20in%20your%20API%20container%E2%80%99s%20environment.%20This%20routes%20requests%20directly%20and%20avoids%20proxy%20restrictions%C2%A0%5Bworkaround%20reference%5D%28https%3A//github.com/langgenius/dify/issues/29792%29.%0A%0ARelaxing%20SSRF%20protection%20increases%20your%20security%20risk%E2%80%94only%20do%20this%20in%20trusted%20environments%20and%20revert%20when%20not%20needed.%20If%20access%20is%20still%20blocked%2C%20check%20%60/var/log/squid/access.log%60%20inside%20the%20%60ssrf_proxy%60%20container%20for%20details%2C%20and%20test%20connectivity%20with%20%60curl%60%20from%20inside%20the%20container.%0A%0AMore%20details%20and%20examples%20are%20available%20in%20%5Bthis%20discussion%5D%28https%3A//github.com/langgenius/dify/discussions/27890%29%20and%20%5Brelated%20issues%5D%28https%3A//github.com/langgenius/dify/issues/28691%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31377)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21831