Closed L1n111ya closed 4 hours ago
I changed the ports of NGINX to 81 and 443, and deployed them on the server, using the port of VSCode to forward and access them in the local browser https://localhost:3000
Hey @L1n111ya! 👋 I'm here to help you with any bugs, questions, or contributions. Let's squash those bugs together!
I found a similar closed issue where a 404 error occurred when creating an app from a template in a self-hosted environment. The issue was resolved by modifying the docker-compose.yml
file to adjust the API environment variables, specifically APP_WEB_URL
and SERVICE_API_URL
, to include the correct URL with the IP and the Nginx exposed port [1].
For your specific issue with the /console/api/setup
endpoint returning a 404 error, consider the following steps:
Check Nginx Configuration: Ensure that your Nginx configuration is correctly set up to forward requests to the appropriate service. Since you've changed the ports to 81 and 443, verify that these changes are reflected in your Nginx configuration files.
Update Environment Variables: Make sure that the environment variables in your docker-compose.yml
or .env
file are correctly set. Specifically, check CONSOLE_API_URL
, CONSOLE_WEB_URL
, SERVICE_API_URL
, APP_API_URL
, and APP_WEB_URL
to ensure they point to the correct URLs and ports.
Verify Docker Setup: Use the command docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }}: {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
to get the correct IP addresses for your services and update your Nginx configuration accordingly [2].
Check for HTML Responses: The SyntaxError: Unexpected token '<'
suggests that an HTML response was received instead of JSON. This might indicate that the request is not reaching the correct API endpoint. Double-check your routing and ensure that the API service is running and accessible.
Restart Services: After making changes, restart your Docker services with docker compose down
followed by docker compose up -d
to apply the changes.
These steps should help resolve the 404 error you're encountering with the /console/api/setup
endpoint.
To continue talking to Dosu, mention @dosu.
3001
is front end endpoint. You are requesting this url for backend services, of course it will failed, please read the docs before changing the ports. Make sure you understand how the port works in docker environment.
Thank you for reply! Which port is backend services?
Self Checks
Dify version
0.12.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
docker compose up -d
[+] Running 9/9 ✔ Container docker-web-1 Running 0.0s ✔ Container docker-sandbox-1 Running 0.0s ✔ Container docker-redis-1 Running 0.0s ✔ Container docker-ssrf_proxy-1 Running 0.0s ✔ Container docker-weaviate-1 Running 0.0s ✔ Container docker-db-1 Running 0.0s ✔ Container docker-worker-1 Running 0.0s ✔ Container docker-api-1 Running 0.0s ✔ Container docker-nginx-1 Started
✔️ Expected Behavior
No response
❌ Actual Behavior