Skip to content

Too many redirect daphne, nginx,django channel ubuntu 20 #401

Answered by halhwadi
halhwadi asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for your reply and assistance
Yes it has nothing with Daphne..

Issue has been solved by:
1- adding protocol header to nginx:
proxy_set_header X-Forwarded-Proto $scheme;

2- Adding the following lines to setting.py file:
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

Third point is adding --proxy-headers to daphne run command in sock file; but not sure if it has any affect on sharing protocol with Django

Best Regards

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@carltongibson
Comment options

@AKRASH-Nadeem
Comment options

@AKRASH-Nadeem
Comment options

Answer selected by carltongibson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #400 on January 26, 2022 09:53.