An error occurred when importing some dls after configuring the domain name. #21517

Closed
opened 2026-02-21 20:12:57 -05:00 by yindo · 2 comments
Owner

Originally created by @Zhangsir125 on GitHub (Jan 8, 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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

In the configuration file configuration
CONSOLE_API_URL
CONSOLE_WEB_URL
SERVICE_API_URL
APP_API_URL
APP_WEB_URL
begind,report an error,Some DSL will not report errors.
I don't know the exact reason, but it seems to be related to the domain name. When the IP address and port number are directly used, the DSL that gives an error can be imported. However, once the configuration file is changed, importing the DSL will result in an error.
Image

✔️ Expected Behavior

Hope to get a solution on how to import dsl without any errors when setting the domain name.

Actual Behavior

No response

Originally created by @Zhangsir125 on GitHub (Jan 8, 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce In the configuration file configuration CONSOLE_API_URL CONSOLE_WEB_URL SERVICE_API_URL APP_API_URL APP_WEB_URL begind,report an error,Some DSL will not report errors. I don't know the exact reason, but it seems to be related to the domain name. When the IP address and port number are directly used, the DSL that gives an error can be imported. However, once the configuration file is changed, importing the DSL will result in an error. ![Image](https://github.com/user-attachments/assets/09130eb1-0754-464b-b8a1-ebb598a239a7) ### ✔️ Expected Behavior Hope to get a solution on how to import dsl without any errors when setting the domain name. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:12:57 -05:00
yindo closed this issue 2026-02-21 20:12:57 -05:00
Author
Owner

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

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

The 403 error when importing DSLs after switching to a domain name is almost always caused by authentication, CSRF, or environment variable misconfiguration. Here’s how to fix it:

  1. Double-check that all relevant environment variables—CONSOLE_API_URL, CONSOLE_WEB_URL, SERVICE_API_URL, APP_API_URL, APP_WEB_URL, and especially COOKIE_DOMAIN—are set to your domain name (including protocol and port if non-standard). They must match the address you use to access Dify in your browser. If any are left empty or inconsistent, cookies won’t be sent, breaking authentication and CSRF checks, which triggers a 403 error reference.

  2. Set WEB_API_CORS_ALLOW_ORIGINS and CONSOLE_CORS_ALLOW_ORIGINS to your frontend domain (or * for testing, but not recommended for production) to avoid CORS-related 403 errors reference.

  3. After updating environment variables, restart all Dify services (API, web, worker, proxy) so the new settings take effect reference.

  4. Use browser dev tools (Network tab) to check that cookies for authentication and CSRF are being set and sent with requests to your domain. If not, the domain or secure flags may be wrong reference.

  5. If you use a reverse proxy (like Nginx) or SSRF proxy (Squid), make sure it forwards all headers and allows your domain/port in its ACLs. Otherwise, requests may be blocked with a 403 reference.

If you still get a 403 after these steps, check backend logs and browser console errors for more details. Most issues are resolved by correcting environment variables and restarting services.

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 8, 2026): <!-- Greeting --> Hi @Zhangsir125! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The 403 error when importing DSLs after switching to a domain name is almost always caused by authentication, CSRF, or environment variable misconfiguration. Here’s how to fix it: 1. Double-check that all relevant environment variables—`CONSOLE_API_URL`, `CONSOLE_WEB_URL`, `SERVICE_API_URL`, `APP_API_URL`, `APP_WEB_URL`, and especially `COOKIE_DOMAIN`—are set to your domain name (including protocol and port if non-standard). They must match the address you use to access Dify in your browser. If any are left empty or inconsistent, cookies won’t be sent, breaking authentication and CSRF checks, which triggers a 403 error [reference](https://github.com/langgenius/dify/issues/16019). 2. Set `WEB_API_CORS_ALLOW_ORIGINS` and `CONSOLE_CORS_ALLOW_ORIGINS` to your frontend domain (or `*` for testing, but not recommended for production) to avoid CORS-related 403 errors [reference](https://github.com/langgenius/dify/issues/11712). 3. After updating environment variables, restart all Dify services (API, web, worker, proxy) so the new settings take effect [reference](https://github.com/langgenius/dify/issues/16019). 4. Use browser dev tools (Network tab) to check that cookies for authentication and CSRF are being set and sent with requests to your domain. If not, the domain or secure flags may be wrong [reference](https://github.com/langgenius/dify/blob/cd1af04dee4c579fa94ce56cb04381bead1ae0f3/api/libs/token.py#L23-L228). 5. If you use a reverse proxy (like Nginx) or SSRF proxy (Squid), make sure it forwards all headers and allows your domain/port in its ACLs. Otherwise, requests may be blocked with a 403 [reference](https://github.com/langgenius/dify/discussions/30676). If you still get a 403 after these steps, check backend logs and browser console errors for more details. Most issues are resolved by correcting environment variables and restarting services. <!-- 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/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5ac02c81-2762-41a5-92ec-3fd9e5b230e0?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=The%20403%20error%20when%20importing%20DSLs%20after%20switching%20to%20a%20domain%20name%20is%20almost%20always%20caused%20by%20authentication%2C%20CSRF%2C%20or%20environment%20variable%20misconfiguration.%20Here%E2%80%99s%20how%20to%20fix%20it%3A%0A%0A1.%20Double-check%20that%20all%20relevant%20environment%20variables%E2%80%94%60CONSOLE_API_URL%60%2C%20%60CONSOLE_WEB_URL%60%2C%20%60SERVICE_API_URL%60%2C%20%60APP_API_URL%60%2C%20%60APP_WEB_URL%60%2C%20and%20especially%20%60COOKIE_DOMAIN%60%E2%80%94are%20set%20to%20your%20domain%20name%20%28including%20protocol%20and%20port%20if%20non-standard%29.%20They%20must%20match%20the%20address%20you%20use%20to%20access%20Dify%20in%20your%20browser.%20If%20any%20are%20left%20empty%20or%20inconsistent%2C%20cookies%20won%E2%80%99t%20be%20sent%2C%20breaking%20authentication%20and%20CSRF%20checks%2C%20which%20triggers%20a%20403%20error%C2%A0%5Breference%5D%28https%3A//github.com/langgenius/dify/issues/16019%29.%0A%0A2.%20Set%20%60WEB_API_CORS_ALLOW_ORIGINS%60%20and%20%60CONSOLE_CORS_ALLOW_ORIGINS%60%20to%20your%20frontend%20domain%20%28or%20%60%2A%60%20for%20testing%2C%20but%20not%20recommended%20for%20production%29%20to%20avoid%20CORS-related%20403%20errors%C2%A0%5Breference%5D%28https%3A//github.com/langgenius/dify/issues/11712%29.%0A%0A3.%20After%20updating%20environment%20variables%2C%20restart%20all%20Dify%20services%20%28API%2C%20web%2C%20worker%2C%20proxy%29%20so%20the%20new%20settings%20take%20effect%C2%A0%5Breference%5D%28https%3A//github.com/langgenius/dify/issues/16019%29.%0A%0A4.%20Use%20browser%20dev%20tools%20%28Network%20tab%29%20to%20check%20that%20cookies%20for%20authentication%20and%20CSRF%20are%20being%20set%20and%20sent%20with%20requests%20to%20your%20domain.%20If%20not%2C%20the%20domain%20or%20secure%20flags%20may%20be%20wrong%C2%A0%5Breference%5D%28https%3A//github.com/langgenius/dify/blob/cd1af04dee4c579fa94ce56cb04381bead1ae0f3/api/libs/token.py%23L23-L228%29.%0A%0A5.%20If%20you%20use%20a%20reverse%20proxy%20%28like%20Nginx%29%20or%20SSRF%20proxy%20%28Squid%29%2C%20make%20sure%20it%20forwards%20all%20headers%20and%20allows%20your%20domain/port%20in%20its%20ACLs.%20Otherwise%2C%20requests%20may%20be%20blocked%20with%20a%20403%C2%A0%5Breference%5D%28https%3A//github.com/langgenius/dify/discussions/30676%29.%0A%0AIf%20you%20still%20get%20a%20403%20after%20these%20steps%2C%20check%20backend%20logs%20and%20browser%20console%20errors%20for%20more%20details.%20Most%20issues%20are%20resolved%20by%20correcting%20environment%20variables%20and%20restarting%20services.)&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/30733)
Author
Owner

@Zhangsir125 commented on GitHub (Jan 8, 2026):

Indeed, the server's firewall blocked the content and immediately returned a 403 error.

@Zhangsir125 commented on GitHub (Jan 8, 2026): Indeed, the server's firewall blocked the content and immediately returned a 403 error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21517