Can't access the public url, it show required authentication is forbiddened. #19935

Closed
opened 2026-02-21 20:05:01 -05:00 by yindo · 6 comments
Owner

Originally created by @ultradawn on GitHub (Oct 26, 2025).

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

v 1.9.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image Image

✔️ Expected Behavior

access the public url

Actual Behavior

No response

Originally created by @ultradawn on GitHub (Oct 26, 2025). ### 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 v 1.9.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="392" height="278" alt="Image" src="https://github.com/user-attachments/assets/cc1b6adf-82e0-4100-8d24-1e609a9d46bb" /> <img width="531" height="199" alt="Image" src="https://github.com/user-attachments/assets/48d1bf25-856f-4dca-b710-a772de719a47" /> ### ✔️ Expected Behavior access the public url ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:05:01 -05:00
yindo closed this issue 2026-02-21 20:05:01 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 26, 2025):

The "authentication is forbidden" error when accessing the public URL in Dify v1.9.2 (self-hosted, Docker) is usually caused by a misconfiguration in your environment variables or Docker setup. Here’s how to fix it:

  1. Make sure your .env file includes WEB_APP_AUTH_ENABLED=False if you want public access without authentication. This variable is not present by default, so you may need to add it manually. After editing, restart your Docker containers for changes to take effect. This will make all apps public, so use with caution if you have sensitive data.
  2. Public URLs and backend API endpoints are managed via environment variables like APP_WEB_URL, SERVICE_API_URL, CONSOLE_WEB_URL, and FILES_URL. Set these to your actual public address (not localhost) in the .env file, then restart Docker containers.
  3. If you use a reverse proxy (like Nginx), configure it to forward requests correctly and set headers like Host, X-Forwarded-For, and X-Forwarded-Proto. Also, set RESPECT_XFORWARD_HEADERS_ENABLED=true in your .env file.
  4. If you see internal Docker addresses (like http://api:5001) in your URLs, check that INTERNAL_FILES_URL is unset or blank, and set FILES_URL to your host’s LAN IP and port.
  5. After any changes, run docker-compose down && docker-compose up -d to reload your configuration.

If you recently updated to v1.9.2, make sure your Docker image is up to date, as incomplete images can cause authentication errors. The backend controls authentication enablement, sometimes via enterprise feature flags, so check backend logs and feature settings if you still see errors.
For more details, see this issue and environment variable docs.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 26, 2025): <!-- Answer --> The "authentication is forbidden" error when accessing the public URL in Dify v1.9.2 (self-hosted, Docker) is usually caused by a misconfiguration in your environment variables or Docker setup. Here’s how to fix it: 1. Make sure your `.env` file includes `WEB_APP_AUTH_ENABLED=False` if you want public access without authentication. This variable is not present by default, so you may need to add it manually. After editing, restart your Docker containers for changes to take effect. This will make all apps public, so use with caution if you have sensitive data. 2. Public URLs and backend API endpoints are managed via environment variables like `APP_WEB_URL`, `SERVICE_API_URL`, `CONSOLE_WEB_URL`, and `FILES_URL`. Set these to your actual public address (not `localhost`) in the `.env` file, then restart Docker containers. 3. If you use a reverse proxy (like Nginx), configure it to forward requests correctly and set headers like `Host`, `X-Forwarded-For`, and `X-Forwarded-Proto`. Also, set `RESPECT_XFORWARD_HEADERS_ENABLED=true` in your `.env` file. 4. If you see internal Docker addresses (like `http://api:5001`) in your URLs, check that `INTERNAL_FILES_URL` is unset or blank, and set `FILES_URL` to your host’s LAN IP and port. 5. After any changes, run `docker-compose down && docker-compose up -d` to reload your configuration. If you recently updated to v1.9.2, make sure your Docker image is up to date, as incomplete images can cause authentication errors. The backend controls authentication enablement, sometimes via enterprise feature flags, so check backend logs and feature settings if you still see errors. For more details, see [this issue](https://github.com/langgenius/dify/issues/23432) and [environment variable docs](https://github.com/crazywoola/dify-docs-mintlify/blob/85f7a55d91d5281b2caef2fde15769178b936c30/en/getting-started/install-self-hosted/environments.mdx). <!-- 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/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f78fa79f-bdb1-46c0-b964-b81efcc1a47c?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/27472)
Author
Owner

@ultradawn commented on GitHub (Oct 26, 2025):

@dosubot I setup the .env with WEB_APP_AUTH_ENABLED=false, not work to me. It's still jumped to http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5

api-1 | 2025-10-27 02:50:44.161 INFO [Thread-236 (process_request_thread)] [_internal.py:97] - 192.168.65.1 - - [27/Oct/2025 02:50:44] "GET /api/passport HTTP/1.1" 401 -
nginx-1 | 192.168.65.1 - - [27/Oct/2025:02:50:44 +0000] "GET /api/passport? HTTP/1.1" 401 121 "http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" "-"
nginx-1 | 192.168.65.1 - - [27/Oct/2025:02:50:44 +0000] "GET /icon-192x192.png HTTP/1.1" 304 0 "http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" "-"

@ultradawn commented on GitHub (Oct 26, 2025): @dosubot I setup the .env with WEB_APP_AUTH_ENABLED=false, not work to me. It's still jumped to http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5 api-1 | 2025-10-27 02:50:44.161 INFO [Thread-236 (process_request_thread)] [_internal.py:97] - 192.168.65.1 - - [27/Oct/2025 02:50:44] "GET /api/passport HTTP/1.1" 401 - nginx-1 | 192.168.65.1 - - [27/Oct/2025:02:50:44 +0000] "GET /api/passport? HTTP/1.1" 401 121 "http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" "-" nginx-1 | 192.168.65.1 - - [27/Oct/2025:02:50:44 +0000] "GET /icon-192x192.png HTTP/1.1" 304 0 "http://localhost/webapp-signin?redirect_url=%252Fchat%252FAjUlJzz9PQlbuiI5" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" "-"
Author
Owner

@dosubot[bot] commented on GitHub (Oct 26, 2025):

Setting WEB_APP_AUTH_ENABLED=false in your .env file does not disable authentication in Dify v1.9.2 because the codebase no longer uses this variable to control public URL access. Instead, authentication is enforced by the enterprise feature flag ENTERPRISE_ENABLED and each app’s access mode. If ENTERPRISE_ENABLED is true, authentication is always required unless the app’s access mode is set to public via the enterprise backend API. The backend checks these flags and app settings, not the WEB_APP_AUTH_ENABLED variable, to decide if authentication is needed. That’s why you still see 401 errors and redirects to /webapp-signin even after changing .env—the variable is ignored in recent versions.

To allow public access, make sure your app’s access mode is set to public in the backend (this usually requires enterprise features), and do not rely on WEB_APP_AUTH_ENABLED in .env—it has no effect in v1.9.2 and later.
More details: feature flag and access mode logic, webapp authentication enforcement.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 26, 2025): <!-- Answer --> Setting `WEB_APP_AUTH_ENABLED=false` in your `.env` file does not disable authentication in Dify v1.9.2 because the codebase no longer uses this variable to control public URL access. Instead, authentication is enforced by the enterprise feature flag `ENTERPRISE_ENABLED` and each app’s access mode. If `ENTERPRISE_ENABLED` is true, authentication is always required unless the app’s access mode is set to `public` via the enterprise backend API. The backend checks these flags and app settings, not the `WEB_APP_AUTH_ENABLED` variable, to decide if authentication is needed. That’s why you still see 401 errors and redirects to `/webapp-signin` even after changing `.env`—the variable is ignored in recent versions. To allow public access, make sure your app’s access mode is set to `public` in the backend (this usually requires enterprise features), and do not rely on `WEB_APP_AUTH_ENABLED` in `.env`—it has no effect in v1.9.2 and later. More details: [feature flag and access mode logic](https://github.com/langgenius/dify/blob/24fb95b0505f08cc6b522ba31defb5477b7a4ee3/api/services/feature_service.py), [webapp authentication enforcement](https://github.com/langgenius/dify/blob/24fb95b0505f08cc6b522ba31defb5477b7a4ee3/api/controllers/web/wraps.py). <!-- 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/a4584576-74af-4490-a544-875ba180c442?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a4584576-74af-4490-a544-875ba180c442?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/27472)
Author
Owner

@ultradawn commented on GitHub (Oct 26, 2025):

how to set the app's access mode to "public"? @dosubot

@ultradawn commented on GitHub (Oct 26, 2025): how to set the app's access mode to "public"? @dosubot
Author
Owner

@dosubot[bot] commented on GitHub (Oct 26, 2025):

In Dify v1.9.2, setting an app's access mode to "public" is managed by the backend enterprise service, not by environment variables or the standard UI. The access mode is controlled via the enterprise backend API, specifically through the EnterpriseService.WebAppAuth.update_app_access_mode method, which can set an app to "public" or "private" mode. This feature is only available if enterprise features are enabled (i.e., ENTERPRISE_ENABLED is true), and is not exposed in the standard self-hosted/community edition UI or API.

If you are running the community/self-hosted version without enterprise features, there is currently no supported way to set an individual app's access mode to "public"—the authentication requirement is enforced globally by the enterprise feature flag and backend logic, not per-app settings. If you have enterprise features enabled, you would need to use the enterprise backend API to update the app's access mode to "public" citation.

If you need all apps to be public and are not using enterprise features, the only workaround is to disable authentication globally by setting WEB_APP_AUTH_ENABLED=false in your .env file and restarting your Docker containers, but this affects all apps and may not be suitable for all use cases.

There is no UI or documented API endpoint in the standard edition for changing an individual app's access mode to "public".

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Oct 26, 2025): <!-- Answer --> In Dify v1.9.2, setting an app's access mode to "public" is managed by the backend enterprise service, not by environment variables or the standard UI. The access mode is controlled via the enterprise backend API, specifically through the EnterpriseService.WebAppAuth.update_app_access_mode method, which can set an app to "public" or "private" mode. This feature is only available if enterprise features are enabled (i.e., ENTERPRISE_ENABLED is true), and is not exposed in the standard self-hosted/community edition UI or API. If you are running the community/self-hosted version without enterprise features, there is currently no supported way to set an individual app's access mode to "public"—the authentication requirement is enforced globally by the enterprise feature flag and backend logic, not per-app settings. If you have enterprise features enabled, you would need to use the enterprise backend API to update the app's access mode to "public" [citation](https://github.com/langgenius/dify/blob/24fb95b0505f08cc6b522ba31defb5477b7a4ee3/api/services/app_service.py). If you need all apps to be public and are not using enterprise features, the only workaround is to disable authentication globally by setting `WEB_APP_AUTH_ENABLED=false` in your `.env` file and restarting your Docker containers, but this affects all apps and may not be suitable for all use cases. There is no UI or documented API endpoint in the standard edition for changing an individual app's access mode to "public". <!-- 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/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0f6677e9-97c0-47d5-9b26-c107c11f897b?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/27472)
Author
Owner

@crazywoola commented on GitHub (Oct 26, 2025):

Please remove the downloaded images and pull it again.

@crazywoola commented on GitHub (Oct 26, 2025): Please remove the downloaded images and pull it again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#19935