Incorrect protocol and port detection when APP_WEB_URL is unset behind Nginx #13070
Open
5 tasks done
Labels
🐞 bug
Something isn't working
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
The Dify frontend relies on the backend to generate some frontend URLs. If APP_WEB_URL is not set, the backend uses request.url_root to determine the URL. However, when running Dify in a Docker environment behind Nginx, request.url_root fails to correctly detect the protocol and port.
I cannot set APP_WEB_URL because clients access my Dify instance from multiple hosts and ports. As a result, leaving APP_WEB_URL unset causes incorrect frontend URL generation in dynamic setups with multiple hosts, ports, or proxies.
Here is a screenshot of what’s happening:
2. Additional context or comments
I propose that we remove APP_WEB_URL completely and let the frontend use window.location.origin instead. Here is a proof of concept for the proposal: #13065
3. Can you help us with this feature?
The text was updated successfully, but these errors were encountered: