Button link does not include the port #5275

Closed
opened 2026-02-21 18:10:14 -05:00 by yindo · 3 comments
Owner

Originally created by @Allamss on GitHub (Aug 28, 2024).

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

0.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

code: /web/app/components/app/app-publisher/index.tsx#190 appURL

env EXPOSE_NGINX_PORT 8082
and link of workflow Run App buttom does not include the port 8082
image
image
image

✔️ Expected Behavior

The link supports the port for correct navigation

Actual Behavior

wrong navigation

Originally created by @Allamss on GitHub (Aug 28, 2024). ### 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 0.7.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce code: /web/app/components/app/app-publisher/index.tsx#190 appURL env EXPOSE_NGINX_PORT 8082 and link of workflow `Run App` buttom does not include the port 8082 ![image](https://github.com/user-attachments/assets/56da721d-1bf3-44f6-a340-2a904b9f987f) ![image](https://github.com/user-attachments/assets/29f6de61-aa51-42a1-a8bf-967e7f2bb837) ![image](https://github.com/user-attachments/assets/813edb62-a527-4f85-8298-0e4931107ec4) ### ✔️ Expected Behavior The link supports the port for correct navigation ### ❌ Actual Behavior wrong navigation
yindo added the 🐞 bug label 2026-02-21 18:10:14 -05:00
yindo closed this issue 2026-02-21 18:10:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 28, 2024):

Hello @Allamss! I'm here to assist you with any bugs, questions, or contributions. Let's work together to address the issue you've encountered.

I found a similar unsolved discussion that might be relevant to your issue: Portforwarding to the App, which was last updated on 2024-08-01 [1].

Regarding your issue, the appURL is constructed in the index.tsx file at line 190 using the app_base_url, appMode, and access_token variables. However, it seems that the port specified in the EXPOSE_NGINX_PORT environment variable is not being included in the URL.

Here is the relevant code snippet from index.tsx:

<EmptyElement appUrl={`${appDetail.site.app_base_url}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`} />

To include the port in the URL, you might need to modify the app_base_url to include the port. For example:

const appBaseURLWithPort = `${appDetail.site.app_base_url}:${process.env.EXPOSE_NGINX_PORT}`;
const appUrl = `${appBaseURLWithPort}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`;

This way, the port specified in the EXPOSE_NGINX_PORT environment variable will be included in the appURL.

Make sure to update the environment variable in your .env file:

EXPOSE_NGINX_PORT=8082

This should ensure that the Run App button generates the correct URL with the port included.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 28, 2024): <!-- Greeting --> Hello @Allamss! I'm here to assist you with any bugs, questions, or contributions. Let's work together to address the issue you've encountered. <!-- Answer --> I found a similar unsolved discussion that might be relevant to your issue: [Portforwarding to the App](https://github.com/langgenius/dify/discussions/6837), which was last updated on 2024-08-01 <sup>[[1]](https://github.com/langgenius/dify/discussions/6837)</sup>. Regarding your issue, the `appURL` is constructed in the `index.tsx` file at line 190 using the `app_base_url`, `appMode`, and `access_token` variables. However, it seems that the port specified in the `EXPOSE_NGINX_PORT` environment variable is not being included in the URL. Here is the relevant code snippet from `index.tsx`: ```tsx <EmptyElement appUrl={`${appDetail.site.app_base_url}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`} /> ``` To include the port in the URL, you might need to modify the `app_base_url` to include the port. For example: ```tsx const appBaseURLWithPort = `${appDetail.site.app_base_url}:${process.env.EXPOSE_NGINX_PORT}`; const appUrl = `${appBaseURLWithPort}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`; ``` This way, the port specified in the `EXPOSE_NGINX_PORT` environment variable will be included in the `appURL`. Make sure to update the environment variable in your `.env` file: ```plaintext EXPOSE_NGINX_PORT=8082 ``` This should ensure that the `Run App` button generates the correct URL with the port included. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@AAEE86 commented on GitHub (Aug 28, 2024):

You need to configure it in the .env file.

@AAEE86 commented on GitHub (Aug 28, 2024): You need to configure it in the .env file.
Author
Owner

@AAEE86 commented on GitHub (Aug 28, 2024):

You'd better change all URIs in Common Variables to yours.

@AAEE86 commented on GitHub (Aug 28, 2024): You'd better change all URIs in Common Variables to yours.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5275