Change urls' scheme from http to https in api-root

106 views
Skip to first unread message

Ruslan Shamsutdinov

unread,
Jan 28, 2021, 5:17:11 AM1/28/21
to Django REST framework
I created an API, deployed it on the server on 8443 port and setup cloudflare's SSL certificates. Everything works perfectly, but I got a problem that urls in api-root still have http scheme. Also I set X-Forwarded-Proto $scheme header in nginx.conf. What could be the problem?

Shaharyar Shamshi

unread,
Jan 28, 2021, 5:51:27 AM1/28/21
to django-res...@googlegroups.com
Add 
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

In setting file

shaharyar shamshi
software developer

On Thu, Jan 28, 2021, 15:47 Ruslan Shamsutdinov <tankru...@gmail.com> wrote:
I created an API, deployed it on the server on 8443 port and setup cloudflare's SSL certificates. Everything works perfectly, but I got a problem that urls in api-root still have http scheme. Also I set X-Forwarded-Proto $scheme header in nginx.conf. What could be the problem?

--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/68921419-b1d4-4e8c-a3c8-379acef2f624n%40googlegroups.com.

Ruslan Shamsutdinov

unread,
Jan 28, 2021, 6:24:37 AM1/28/21
to Django REST framework
It worked. Thank you. But what does django do with this variable? I mean how it reads it?
четверг, 28 января 2021 г. в 15:51:27 UTC+5, shaharya...@gmail.com:

VenkataSivaRamiReddy

unread,
Jan 28, 2021, 7:42:48 AM1/28/21
to django-res...@googlegroups.com
can anyone share me or help me for python+flask or python+django Application deployment steps on AWS or Azure

Shaharyar Shamshi

unread,
Jan 28, 2021, 8:26:34 AM1/28/21
to django-res...@googlegroups.com
They must be separate microservice ?

shaharyar shamshi
software developer

Sudhakar Donkena

unread,
Jan 28, 2021, 9:09:29 AM1/28/21
to django-res...@googlegroups.com
How you want to be deploy it? like there are few ways to deploy it . You can create executable file and deploy it on web server and configure supervisord to up run your application in demon mode

VenkataSivaRamiReddy

unread,
Jan 28, 2021, 9:43:41 AM1/28/21
to django-res...@googlegroups.com
i dont have idea on ti but i want to make my Flask Rest API application to live using AWS EC2

Shaharyar Shamshi

unread,
Jan 28, 2021, 10:16:20 AM1/28/21
to django-res...@googlegroups.com
Learn about uwsgi and you can make docker image 

shaharyar shamshi
software developer

Reply all
Reply to author
Forward
0 new messages