dify icon indicating copy to clipboard operation
dify copied to clipboard

After deploying the non-80 port, publish the application and jump to the new web page to carry the port.

Open kokojacket opened this issue 9 months ago • 6 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

latest

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image image image

✔️ Expected Behavior

You should also need to carry port 3000 before you can use it after the jump__

❌ Actual Behavior

After deploying the non-80 port, publish the application and jump to the new web page to carry the port. image

kokojacket avatar May 16 '24 07:05 kokojacket

To address the "404 Not Found" error when accessing your application on port 3000, ensure the following:

  1. Application Configuration: Confirm your application's configuration files correctly reference port 3000. This is crucial for the application to expect traffic on this port.

  2. Web Server Configuration: If using a web server like Nginx or Apache as a reverse proxy, it must be configured to forward requests to your application on port 3000. This involves setting up a server block or virtual host to either listen on port 3000 or forward requests to localhost:3000.

  3. Firewall and Network Configuration: Check that your server's firewall rules allow incoming connections on port 3000. Additionally, if behind a router or firewall, set up port forwarding to direct traffic to your server on this port.

  4. Verify Application is Running: Ensure your Dify application is running and listening on port 3000. Use commands like netstat -tuln | grep 3000 or lsof -i :3000 to check.

  5. DNS and Browser Cache: If using a domain name, ensure DNS settings correctly point to your server's IP. Also, clear your browser cache and cookies to avoid issues with cached redirects or site versions.

In your docker-compose.yml, under the service you wish to expose (e.g., web for the frontend web application), ensure the ports configuration is set to "3000:3000" to map port 3000 of the host to port 3000 of the container, making it accessible externally.

Dify uses the yarl library for URL generation and manipulation, which supports dynamic construction of URLs, including appending paths and handling non-standard ports efficiently.

By following these steps and ensuring correct configuration and environment setup, you should be able to resolve the "404 Not Found" error and access your web page on port 3000.

Details

Sources


About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

dosubot[bot] avatar May 16 '24 07:05 dosubot[bot]

I don't really get the issue here. Have you change something in docker-compose file?

patryk20120 avatar May 16 '24 17:05 patryk20120

image I only changed this

kokojacket avatar May 20 '24 07:05 kokojacket

So you should access the web on that port http://localhost:10034

patryk20120 avatar May 20 '24 07:05 patryk20120

So you should access the web on that port http://localhost:10034

I used a reverse proxy tool to proxy http://localhost:10034/ to the public network. Then when I used "publish", the port would disappear when jumping. __

kokojacket avatar May 20 '24 07:05 kokojacket

may be web should add nginx expose-port config, rather than always use 80

superstring avatar May 20 '24 10:05 superstring

docker-compose.yml,needs to modify Api: environment variables, APP_WEB_URL,SERVICE_API_URL,fill in 'http://ip:nginx expose-port'

kuit123 avatar May 23 '24 02:05 kuit123

Yes my problem is solved now__

kokojacket avatar May 23 '24 02:05 kokojacket

Yes my problem is solved now_

what is the method?

ml-dl-ysw avatar Sep 09 '24 02:09 ml-dl-ysw

是的,我的问题现在解决了_

方法是什么?

同问

torans avatar Sep 25 '24 03:09 torans