Replies: 3 comments 11 replies
-
|
You can't use http://localhost:8080 or http://127.0.0.1:8080 in the HTTP request node if Dify is running in Docker or a similar containerized environment. Inside the container, localhost refers to the container itself, not your host machine. Also, Dify uses SSRF protection that may block requests to local/private addresses for security reasons, which can cause these requests to fail even if the network is otherwise reachable cite. To work around this, use your host machine's LAN IP (for example, http://192.168.x.x:8080) or, if you're on Docker Desktop, use http://host.docker.internal:8080 instead of localhost or 127.0.0.1 cite cite cite. Make sure your local server is listening on all interfaces (0.0.0.0), not just 127.0.0.1, and that the port is exposed to the Docker network. If you still have trouble, check that SANDBOX_ENABLE_NETWORK=true is set in your environment, and confirm that your containers are on the same Docker network with the correct ports exposed cite cite. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Based on your screenshots, I see the issue - you've modified the .env file but the environment variable syntax might not be correct in Dify's HTTP node. Here's the fix: Step-by-step solution:
Note the
This will resolve to:
docker-compose down
docker-compose up -dEnvironment variables are loaded at startup, so changes require a restart.
Try this and let me know if it works for you! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for sharing the screenshot! I can see the issue - it looks like the {{#env.BASE_URL#}} syntax isn't being recognized. Let me help you debug this step by step: Common causes and solutions:1. Docker Restart (Most Common)The most frequent reason environment variables don't work is forgetting to restart Docker after updating .env: Dify only reads environment variables at startup, so changes require a restart. 2. Verify .env File FormatCheck that your
3. Check Variable Availability in DifySome versions of Dify may need the variable defined in the right configuration file. Try these: Option A: Edit Option B: If using docker-compose, add directly in the service: environment:
- BASE_URL=http://192.168.12.34:80804. Verify Syntax in HTTP NodeMake sure you're using the EXACT syntax:
5. Check Docker Network & ConnectionShare:
6. Alternative: Use host.docker.internalIf you're on Mac or Windows with Docker Desktop, try: Then use Can you try restarting Docker and let me know the exact error message? That will help narrow down the issue further! |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I want use http request node to request a local Http Server, at the url field, it seem that I can't use “http://localhost:8080/xxx” or "http://127.0.0.1:8080/xxx" to send request.
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions