dify
dify copied to clipboard
After deploying the non-80 port, publish the application and jump to the new web page to carry the port.
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
✔️ 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.
To address the "404 Not Found" error when accessing your application on port 3000, ensure the following:
-
Application Configuration: Confirm your application's configuration files correctly reference port 3000. This is crucial for the application to expect traffic on this port.
-
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
. -
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.
-
Verify Application is Running: Ensure your Dify application is running and listening on port 3000. Use commands like
netstat -tuln | grep 3000
orlsof -i :3000
to check. -
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
- Reflecting the changed port for Public URL port and Service API port
- nginx当使用自定义端口 比如 3005:80时,创建的应用,点击预览的时候,默认还是80端口。
- api/.env.example
- docker/docker-compose.yaml
- en/getting-started/install-self-hosted/environments.md
- api/app.py
- docker/docker-compose.middleware.yaml
- api/tests/unit_tests/libs/test_yarl.py
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.
I don't really get the issue here. Have you change something in docker-compose file?
I only changed this
So you should access the web on that port http://localhost:10034
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. __
may be web should add nginx expose-port config, rather than always use 80
docker-compose.yml,needs to modify Api: environment variables, APP_WEB_URL,SERVICE_API_URL,fill in 'http://ip:nginx expose-port'
Yes my problem is solved now__
Yes my problem is solved now_
what is the method?
是的,我的问题现在解决了_
方法是什么?
同问