django rest framework https for absolute urls?

后端 未结 2 1492
天涯浪人
天涯浪人 2021-01-05 17:04

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

2条回答
  •  Happy的楠姐
    2021-01-05 17:19

    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;
    

提交回复
热议问题