Nginx is likely reporting 127.0.0.1 not Discourse it self, you will probably need to set up realip in nginx