Admin panel gives 404 not found on reloading page

System Information
  • Strapi Version: 3.6.6
  • Operating System: Ubuntu 20.04
  • Database: Postgres 11
  • Node Version: 14.17.6
  • NPM Version: 6.14.15
  • Yarn Version: 1.22.11


I am trying to create separate deployments for the Strapi API and the Admin Panel. I read the documentation and followed the steps to set “serveAdminPanel” to false as given in Admin panel customization - Strapi Developer Documentation

However I need to serve the admin panel from a docker container (not from AWS/Azure). How do I serve the admin panel that is built in the build/ directory? I tried using the npm ‘serve’ module and python SimpleHTTPServer - using them, the admin panel works correctly and connects to the API backend.

Everything works correctly except when I refresh a page that is not the root “/”, I get a 404 “The requested path could not be found”.
On reloading a page in the admin panel (for example restaurant content-type), the url it tries to reach is “/plugins/content-manager/collectionType/”. which is not present in the build/ directory. (no plugins directory in build directory)

Hence can anyone please let me know what is the correct way of serving the admin panel “build/” directory?

The reload/refresh page (not autoReload) works correctly when the admin panel is deployed using “yarn develop --watch-admin”. How is the admin panel being served here? I want to serve it in a similar way in production.

Thanks in advance!