0
votes

I'm running my DJango app using uwsgi over nginx. it's currently working with these configurations:

[uwsgi] socket = :8002

master = true

env = DJANGO_SETTINGS_MODULE=web_server.web_server.settings

pythonpath = /tmp/src/

wsgi-file = /tmp/src/web_server/web_server/wsgi.py

chdir = /tmp/src/

processes = 4

threads = 2

and my nginx.conf file

upstream django {

server 127.0.0.1:8002;

}

server {

listen 8000;

server_name 192.168.56.104;

charset utf-8;

# Finally, send all non-media requests to the Django server.

location / {

   uwsgi_pass  django;
   include     /tmp/src/web_server/web_server/uwsgi_params;

}

it's working with http.

I want to change it to work with https, but I can't find the right to configuration to make that work anywhere.

What should I change in my configuration in order to work with https?

I already have generated the certificate .

1
Every server setup and certificate file is a little different with requirements. I would take a look at this documentation digicert.com/ssl-certificate-installation-nginx.htm and post specific technical questions if you can't get it working.Chris Hawkes
thanks. that actually solved my problem.ShlomiK
@ShlomiK If you have a solution, then please post it as an answer. Or if you think that the solution is too specific to your own situation, then delete the question. Thank you.Louis
ok. adding the solutionShlomiK

1 Answers

0
votes

Chris's comment helped me find the solution. in SSL Certificate Installation in Nginx you can find this:

ssl on;

ssl_certificate /etc/ssl/your_domain_name.pem; (or bundle.crt)

ssl_certificate_key /etc/ssl/your_domain_name.key;

I just added it to my nginx .conf file and that added https to my web server. so the final .conf file looks like this:

upstream django {

server 127.0.0.1:8002;

}

server {

listen 8000;

ssl on;

ssl_certificate /etc/ssl/your_domain_name.pem; (or bundle.crt)

ssl_certificate_key /etc/ssl/your_domain_name.key;

server_name 192.168.56.104;

charset utf-8;

# Finally, send all non-media requests to the Django server.

location / {

  uwsgi_pass  django;

  include     /tmp/src/web_server/web_server/uwsgi_params;

}