Hey guys!
I could really use your help, I am at my wits ent (and at my AI’s wits end, too).
I am unable to get the OpenAPI working.
Environment:
-
Directus Version: 11.16.0 (Dockerized)
-
Database: MySQL 8.4.8 (LTS)
-
Deployment: Docker Compose, Nginx Reverse Proxy (SSL via Certbot)
-
Node Version: (Inside container) 20.x/22.x (Standard Directus image)
The Issue: The OpenAPI specification endpoint (/server/specs/openapi and /server/specs/openapi.json) returns a 404 ROUTE_NOT_FOUND error. This persists even after confirming that all required environment variables are set and the database schema is healthy.
Confirmed Working:
-
GET /server/infoandGET /server/healthreturn 200 OK. -
Standard data endpoints (e.g.,
GET /items/partners) return 200 OK with data. -
Directus Admin App is fully functional.
-
The database connection is stable.
Troubleshooting Steps Taken:
-
Environment Variables: Verified that
API_SPEC_ENABLED="true"andPUBLIC_URL="https://api.rebernik.cz"are correctly passed to the container. -
Permissions: * Tested both with
API_SPEC_ROLE="public"and without it (Admin only).- Confirmed that the Public role has “Read” permissions for all application collections and relevant system collections (
Collections,Fields,Permissions,Policies).
- Confirmed that the Public role has “Read” permissions for all application collections and relevant system collections (
-
Database Health: * Initial
WARNlogs indicated a collation mismatch between system tables (utf8mb4_unicode_ci) and application tables (utf8mb4_0900_ai_ci).-
Action taken: Manually converted all application tables to
utf8mb4_unicode_cito match Directus internal defaults. -
Result: The startup warnings disappeared (
INFO: Extensions loadedis clean), but the 404 error on/server/specs/openapipersists.
-
-
Reverse Proxy: * Confirmed Nginx is passing headers correctly.
- Tested direct internal requests (bypassing Nginx) with the same 404 result.
-
Cache/Refresh: Attempted hard reloads and container restarts after each config change.
Observed Behavior: Even with no startup errors or warnings, the Directus internal router does not seem to register the /server/specs route. It acts as if the OpenAPI module is either disabled or failing silently during initialization.
Any ideas on what I should try next? ![]()
Thank you,
Alena