Client - LB - App Server
I have an app that supports http or https. If the original request is https, but the server is expecting http, it won't work.
Is it possible to use nginx to rewrite the x-forwarded-for? The client requests https://x.x.x.x, but the server sees http://x.x.x.x
The load balancer is "terminating" your SSL connection at that point, so all requests behind the LB will go in HTTP. The way to do this is to use nginx listening on SSL then proxy-pass the connection to your application.