[USE_X_FORWARDED_HOST] drf application with proxy pass(nginx) #7793
Unanswered
Devansh3790
asked this question in
Question & Answer
Replies: 2 comments
-
Added a demo app. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The issue is a bit old but if you haven't found the solution, here it is. Django is using by default the First Solution
Second solution if you want to use In your settings file: USE_X_FORWARDED_HOST=True You need to set the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checklist
master
branch of Django REST framework.Steps to reproduce
localhost:8000
gives me following output.localhost:81
application is working file but the problam with the response;Actual behavior
Here you can notice that the value for key
users : "http://localhost/users/"
.Expected behavior
It should be
"http://localhost:81/users/"
.I did a search on the problem and found the
USE_X_FORWARDED_HOST
from Django document. What explained there tried to search in DRF code but didn't find such kind of logic which will resolve this issue.Beta Was this translation helpful? Give feedback.
All reactions