error in production when using redis for cache and session I've added this to the array that is returned in config/app.php:
'components' =&gt; [
        'redis' =&gt; [
            'class' =&gt; yii\redis\Connection::class,
            'hostname' =&gt; App::env('REDIS_HOST'),
            'port' =&gt; APP::env('REDIS_PORT'),
            'password' =&gt; ''
        ],
        'cache' =&gt; [
            'class' =&gt; yii\redis\Cache::class,
            'defaultDuration' =&gt; 86400,
            'keyPrefix' =&gt; App::env('APP_ID') ?: 'CraftCMS',
        ],

        'session' =&gt; function() {
            // Get the default component config
            $config = App::sessionConfig();

            // Override the class to use Redis' session class
            $config['class'] = yii\redis\Session::class;

            // Instantiate and return it
            return Craft::createObject($config);
        },
        
    ]

This all works find when my environment is in dev and devMode is on.
When I switch to production, I get an internal server error. I don't know what the issue is because it doesn't give me the full logs.
Luckily, someone else had this problem: https://github.com/craftcms/cms/issues/7617#issuecomment-786715807
The issue was because of leaving the password blank. devMode did not care, but production did. Had to remove the password entirely