encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
27.83k stars 6.76k forks source link

HyperlinkedModelSerializer doesn't respect SECURE_PROXY_SSL_HEADER settings #9376

Closed ykursav closed 2 months ago

ykursav commented 2 months ago

Hello,

I am using django behind docker proxy and after that with nginx reverse proxy (serves as http). Docker proxy wrapping around nginx for https. The issue when I set SECURE_PROXY_SSL_HEADER like below, I am retrieving HyperlinkedModelSerializer url field as http instead of https. In my opinion, expected behaviour should be returning https and respecting that django setting.

SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

Checklist