When using HTTP / HTTPS as the load balancing protocol, we get the requested source protocol (i.e., it is HTTP or HTTPS) from the header x-forwarded-protocol. Now, using this header in the nginx configuration, you can determine if there was an outgoing call from HTTP or HTTPS, and the action could be performed accordingly.
But if the configuration of the ELB listeners matches the image below, then how do you determine if a request came through port 80 or port 443?

source
share