try this: proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Server ssl; proxy_set_header HTTPS 1; and then let the app ask for one of these headers. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,123625,123962#msg-123962