Admin Panel is not showing up in production

System Information
  • Strapi Version: 3.5.3
  • Operating System: CentOs
  • Database: mongodb
  • Node Version: 10.24.0
  • NPM Version: 7.7.0
  • Yarn Version: 1.22.10

server.js

module.exports = ({ env }) => ({
  host: env("HOST", "0.0.0.0"),
  port: env.int("PORT", 1337),
  url: env("NODE_ENV", "development") == "production" ? "https://api.example.com/" : "http://localhost:1337/",
  admin: {
    url: "/",
    serveAdminPanel: true,
    autoOpen: false,
    auth: {
      secret: env("ADMIN_JWT_SECRET", "someToken"),
    },
  },
  cron: { enabled: true },
});

When I run pm2 start ecosystem.config.js --env development it shows the admin panel on production but disables it when --env is set to production.

Can anyone help me enabling admin panel for production too?

How are you accessing the admin panel? Are you using it behind nginx by any chance?
Also if you can share more info about how the app is deployed, I might help.