Closed ClementeGao closed 2 days ago
@ClementeGao Hello there! I'm here to help you with bug reports, answer questions, and assist you in becoming a contributor while we wait for a human maintainer.
The "404 page not found" error when calling the API with a POST request using a Bearer token authorization could be due to a misconfiguration in the domain/URL settings, causing cross-domain issues between the frontend and backend.
To resolve this, ensure that the following configuration items in docker-compose.yml
are updated to the correct domain:
CONSOLE_API_URL
: Backend URL for the console API.CONSOLE_WEB_URL
: Frontend URL for the console web.SERVICE_API_URL
: URL for the service API.APP_API_URL
: Backend URL for the WebApp API.APP_WEB_URL
: URL for the WebApp.Additionally, verify the CORS configuration:
CONSOLE_CORS_ALLOW_ORIGINS
: Console CORS policy, default is *
, meaning all domains can access.WEB_API_CORS_ALLOW_ORIGINS
: WebAPP CORS policy, default is *
, meaning all domains can access.Ensure these configurations are correctly set to allow cross-domain requests.
If the issue persists, it might be due to switching the domain name/website, causing cross-domain issues between the front-end and server-side. Make sure to update all the relevant configuration items in docker-compose.yml
to the new domain name.
If you encounter a "502 Bad Gateway" error, it might be due to Nginx forwarding requests to the wrong location. Ensure the containers are running and use the following command to get the correct IP addresses:
docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
Update the Nginx configuration in dify/docker/nginx/conf.d
with the correct IP addresses for api
and web
services, then restart the Nginx container or reload the configuration [1][2].
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
latest
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
i had publish application, but can not access
✔️ Expected Behavior
return correct result
❌ Actual Behavior
404 page not found