You may also have to update config/env/production/middlewares.ts if you have different files for production.
config/env/production/middlewares.ts