the **agent-Monitoring-Public URL** field automatically populates an address without the port #8350

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

Originally created by @d960124 on GitHub (Feb 17, 2025).

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

Version 0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When deploying Dify with a port number in the access URL, the agent-Monitoring-Public URL field automatically populates an address without the port . Users must manually append the port when copying this value. Similarly, the API address also lacks port information, as the system currently retrieves the root address without port details by default.

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @d960124 on GitHub (Feb 17, 2025). ### 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 Version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When deploying Dify with a port number in the access URL, the **agent-Monitoring-Public URL** field automatically populates an address without the port . Users must manually append the port when copying this value. Similarly, the API address also lacks port information, as the system currently retrieves the root address without port details by default. ![Image](https://github.com/user-attachments/assets/d1a67e0d-9f47-49e2-a360-134f05a4f769) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:25:12 -05:00
yindo closed this issue 2026-02-21 18:25:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 17, 2025):

Hey @d960124! 👋 I'm here to help you with any bugs, questions, or contributions you have while we wait for a human maintainer. I'm Dosu, a bot that's great at squashing bugs and answering technical questions. Let's tackle this together!

I found two similar unsolved discussions that might be relevant to your issue:

  1. Public URL/ API Incorrect problem - This discussion addresses issues with incorrect public URLs or API addresses, which might be related to the problem you're experiencing [1].

  2. Portforwarding to the App - This discussion involves port forwarding issues, which could be relevant if your problem is related to port handling in URLs [2].

Regarding your issue, Dify handles the generation of the agent-Monitoring-Public URL and API address using environment variables or attributes from the document body. The logic is implemented in the web/config/index.ts file. If the environment variables NEXT_PUBLIC_API_PREFIX and NEXT_PUBLIC_PUBLIC_API_PREFIX are not set, it defaults to local URLs without port numbers [3].

To include port numbers, you can specify them in the .env file by adjusting the Nginx settings and API service configurations:

EXPOSE_NGINX_PORT=80
EXPOSE_NGINX_SSL_PORT=443
DIFY_BIND_ADDRESS=0.0.0.0
DIFY_PORT=5001

These settings allow you to specify the bind address and port number for the API service [4][5].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 17, 2025): <!-- Greeting --> Hey @d960124! 👋 I'm here to help you with any bugs, questions, or contributions you have while we wait for a human maintainer. I'm [Dosu](https://dosu.dev), a bot that's great at squashing bugs and answering technical questions. Let's tackle this together! <!-- Answer --> I found two similar unsolved discussions that might be relevant to your issue: 1. [Public URL/ API Incorrect problem](https://github.com/langgenius/dify/discussions/12371) - This discussion addresses issues with incorrect public URLs or API addresses, which might be related to the problem you're experiencing <sup>[[1]](https://github.com/langgenius/dify/discussions/12371)</sup>. 2. [Portforwarding to the App](https://github.com/langgenius/dify/discussions/6837) - This discussion involves port forwarding issues, which could be relevant if your problem is related to port handling in URLs <sup>[[2]](https://github.com/langgenius/dify/discussions/6837)</sup>. Regarding your issue, Dify handles the generation of the agent-Monitoring-Public URL and API address using environment variables or attributes from the document body. The logic is implemented in the `web/config/index.ts` file. If the environment variables `NEXT_PUBLIC_API_PREFIX` and `NEXT_PUBLIC_PUBLIC_API_PREFIX` are not set, it defaults to local URLs without port numbers <sup>[[3]](https://github.com/langgenius/dify/blob/main/web/config/index.ts)</sup>. To include port numbers, you can specify them in the `.env` file by adjusting the Nginx settings and API service configurations: ```plaintext EXPOSE_NGINX_PORT=80 EXPOSE_NGINX_SSL_PORT=443 DIFY_BIND_ADDRESS=0.0.0.0 DIFY_PORT=5001 ``` These settings allow you to specify the bind address and port number for the API service <sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/faq.md)</sup><sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/environments.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3d5121a8-2fca-4dbc-a691-578a5a3fda8a?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 17, 2025):

Read the docs here https://docs.dify.ai/getting-started/install-self-hosted/environments
You need to adjust APP_WEB_URL .

@crazywoola commented on GitHub (Feb 17, 2025): Read the docs here https://docs.dify.ai/getting-started/install-self-hosted/environments You need to adjust `APP_WEB_URL `.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8350