The server hosting the api is returning http for absolute urls even though the page was loaded using https, does this have something to do with django rest framework? becaus
You need to make sure nginx forwards the client's request scheme because it'll make a regular http request to Django. You'll need to add the following line to your vhost definition:
proxy_set_header X-Forwarded-Proto $scheme;
Are you using Rest Framework reverse() function to build URLs? http://www.django-rest-framework.org/api-guide/reverse/
It uses incoming request to determine the protocol used.