fixes for poly api in nginx context -- functional!