It is working. Thanks! For the record: I moved error_page 497 = @https; to server section. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,155978,213379#msg-213379