HTTPS variable in $_SERVER using nginx as reverse proxy

view full story

http://serverfault.com – I'm using nginx as a reverse proxy in front of an apache with mod_php. My site is on https, and it would require the variable $_SERVER['HTTPS'] to be set 'on' to assemble some of the links correctly. My site is on drupal, so it is not an option to fix the code and check an other variable when deciding if the site runs under https. Is there a way to fix the issue only with tweaking the nginx or apache configuration? I found other people asking similar questions, but I did not found a solution that suits me, neither a clear statement that what I want is not possible. (e.g.: HTTPS server/php v (HowTos)