DRF: drf_yasg中将Schemes从HTTP更改为HTTPS

settings.py

USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = (‘HTTP_X_FORWARDED_PROTO‘, ‘https‘)

nginx.conf

    # Finally, send all non-media requests to the Django server.
    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $http_host;
        proxy_redirect off;

        if (!-f $request_filename) {
            proxy_pass http://app_django_server;
            break;
        }
    }

 

showtooltip

DRF: drf_yasg中将Schemes从HTTP更改为HTTPS

上一篇:js比较版本号


下一篇:url采集工具,url采集器