Cannot open "Run App" in "Publish" when default port is changed #12548

Closed
opened 2026-02-21 19:07:56 -05:00 by yindo · 3 comments
Owner

Originally created by @Inokinoki on GitHub (Apr 4, 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 1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Change nginx port, e.g.,
$ diff .env .env.example 
930,931c930,931
< EXPOSE_NGINX_PORT=12580
< EXPOSE_NGINX_SSL_PORT=12443
---
> EXPOSE_NGINX_PORT=80
> EXPOSE_NGINX_SSL_PORT=443
  1. Open an application
  2. Click open "Publish" and "Run App"

✔️ Expected Behavior

Redirect to the right URL with port.

Actual Behavior

The new opened page contains the URL without the port, and then fails to connect.

Originally created by @Inokinoki on GitHub (Apr 4, 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 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Change nginx port, e.g., ``` $ diff .env .env.example 930,931c930,931 < EXPOSE_NGINX_PORT=12580 < EXPOSE_NGINX_SSL_PORT=12443 --- > EXPOSE_NGINX_PORT=80 > EXPOSE_NGINX_SSL_PORT=443 ``` 2. Open an application 3. Click open "Publish" and "Run App" ### ✔️ Expected Behavior Redirect to the right URL with port. ### ❌ Actual Behavior The new opened page contains the URL without the port, and then fails to connect.
yindo added the 🐞 bug label 2026-02-21 19:07:56 -05:00
yindo closed this issue 2026-02-21 19:07:56 -05:00
Author
Owner

@Inokinoki commented on GitHub (Apr 4, 2025):

Could be related in web/app/components/app/app-publisher/index.tsx:

  const appDetail = useAppStore(state => state.appDetail)
  const { app_base_url: appBaseURL = '', access_token: accessToken = '' } = appDetail?.site ?? {}
  const appMode = (appDetail?.mode !== 'completion' && appDetail?.mode !== 'workflow') ? 'chat' : appDetail.mode
  const appURL = `${appBaseURL}/${appMode}/${accessToken}`
@Inokinoki commented on GitHub (Apr 4, 2025): Could be related in `web/app/components/app/app-publisher/index.tsx`: ``` const appDetail = useAppStore(state => state.appDetail) const { app_base_url: appBaseURL = '', access_token: accessToken = '' } = appDetail?.site ?? {} const appMode = (appDetail?.mode !== 'completion' && appDetail?.mode !== 'workflow') ? 'chat' : appDetail.mode const appURL = `${appBaseURL}/${appMode}/${accessToken}` ```
Author
Owner

@dosubot[bot] commented on GitHub (Apr 4, 2025):

Hey @Inokinoki! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and navigate your way to becoming a contributor while you wait for a human maintainer. Let's tackle this together! 🚀

I found a similar open issue that might be related to your problem. The issue suggests modifying the app_base_url to include the port in the URL. You can update the code in index.tsx as follows:

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

Additionally, ensure that the EXPOSE_NGINX_PORT environment variable is set in your .env file:

EXPOSE_NGINX_PORT=12580

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

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 (Apr 4, 2025): <!-- Greeting --> Hey @Inokinoki! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and navigate your way to becoming a contributor while you wait for a human maintainer. Let's tackle this together! 🚀 <!-- Answer --> I found a similar open issue that might be related to your problem. The issue suggests modifying the `app_base_url` to include the port in the URL. You can update the code in `index.tsx` as follows: ```tsx const appBaseURLWithPort = `${appDetail.site.app_base_url}:${process.env.EXPOSE_NGINX_PORT}`; const appUrl = `${appBaseURLWithPort}/${getWebAppType(appDetail.mode)}/${appDetail.site.access_token}`; ``` Additionally, ensure that the `EXPOSE_NGINX_PORT` environment variable is set in your `.env` file: ```plaintext EXPOSE_NGINX_PORT=12580 ``` This should ensure that the `Run App` button generates the correct URL with the port included <sup>[[1]](https://github.com/langgenius/dify/issues/7761)</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/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6af5a962-a568-491d-a2c1-a01e88554d5b?feedback_type=other)</sup>
Author
Owner

@Inokinoki commented on GitHub (Apr 4, 2025):

Duplication of #7761

@Inokinoki commented on GitHub (Apr 4, 2025): Duplication of #7761
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12548