1

this is my nginx conf for project please say me why it doesn't work

upstream django {
    server 127.0.0.1:8037;
}
server {
server_name                        ;
listen        :80;
return 301 https://www.                 $request_uri;
}
server {
   listen 443 ssl;

ssl_certificate /etc/nginx/ssl.crt/server.crt;
ssl_certificate_key /etc/nginx/ssl.key/server.key;

server_name                               ;

charset   utf-8;
server_tokens       off;
access_log /etc/nginx/log/access.log;

error_log /etc/nginx/log/error.log;

location /static/ {
    alias   /home/app/public_html/Vishka/env/repo/project/Vishka/static/;
}


location / {
        include uwsgi_params;
        uwsgi_pass django;
}
}

in uwsgi log there is no request all of my requests will be lose enter image description here

2 Answers 2

0

Check at server with port 80 at the scheme

if ($scheme != "https") {
                return 301 https://$host$request_uri;
        }

Make sure also that configuration has valid syntax

listen       80 default_server;
listen       [::]:80 default_server;

listen       443 ssl http2 default_server;
listen       [::]:443 ssl http2 default_server;
0

that was because of that a sub domain has been set to my server and i refer the main domain in ssl setting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.