Django next url to HTTPS (Nginx)

Issue

I have added a SSL certificate to my nginx application, everything works fine, but when django paginates for the next url it uses: http:// not https:// How can I change this?
enter image description here

Solution

I have solved the issue: Under proxy_pass http://django; SET

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

Also need to set

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

in setting.py file.

Answered By – Greedy Pointer

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.