Error: Cannot send secure cookie over unencrypted connection, proxy is already set to true

System Information
  • Strapi v4.5.6:
  • Ubuntu 22.04.1 LTS running on an AWS EC2 instance:
  • (node v16.17.0:

I have three lower environments (development, qa, stg) all running in similar ubuntu servers running on an AWS EC2 instance, all connecting to their respective Cognito user pools, and all three log in without error.
In the production environment only, the call to /api/connect/cognito returns the error “Error: Cannot send secure cookie over unencrypted connection”
My /config/server.js reads as follows:
module.exports = ({ env }) => ({
host: env(‘HOST’),
url: env(‘URL’),
proxy: true,
app: {
keys: env.array(‘APP_KEYS’),

Every answer I have seen to this question has said the solution is to add proxy: true to the server.js, which I have done, but I am still getting the error.

What am I missing?

I try to remove NODE_ENV=production it works