7
7
7761662019-07-31 16:38:02
Django
776166, 2019-07-31 16:38:02

Nginx on https -> Django on runserver -> DRF + swagger. How to make swagger go to https instead of http?

There is a subj.

Django==2.2.3
django-rest-swagger==2.1.2
djangorestframework==3.8.2

Everything is closed by nginx to https, which proxies, as it should be for runserver to http, and redirects incoming http traffic to https. Swagger is generated in such a way that requests must go to http, which, of course, is hacked by the browser even without options to send to http and be redirected to https.
Can this somehow be fixed by leaving only https for the outside world?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
7
776166, 2019-07-31
@776166

Understood.
In settings.py
In nginx
The problem was that they write inaccurately on the Internet, and in addition to copy-paste, you also sometimes have to think.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question