django uwsgi nginx redhat 7 unix socket - PullRequest
0 голосов
/ 19 марта 2019

uwsgi --http: 8000 --chdir / pathtohomeproject --wsgi.file /pathtowsgifile.py, когда я делаю это, но когда я пытаюсь использовать сокеты вместо http, это не работает.Окружение - redhat 7 django2.1 и python3.Я бьюсь головой весь день, чтобы решить это.Может кто-нибудь сказать мне, как это исправить, я не знаю, что это за ошибка.

my mysite.conf

# mysite_nginx.conf

# the upstream component nginx needs to connect to
upstream django {
    server unix:///Website/bluetext_reviewer/AutomationServices/site.sock; # for a file socket
    # server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}

# configuration of the server
server {
    # the port your site will be served on
    listen      8000;
    # the domain name it will serve for
    # substitute your machine's IP address or FQDN
    server_name sjautowebdevn01;
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;   # adjust to taste

    # Django media
    location /media  {
        # your Django project's media files - amend as required
        alias /Website/bluetext_reviewer/AutomationServices/media;
    }

    location /static {
        # your Django project's static files - amend as required
        alias /Website/bluetext_reviewer/AutomationServices/static;
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  unix:///Website/bluetext_reviewer/AutomationServices/site.sock;
        # the uwsgi_params file you installed
        include     /Website/bluetext_reviewer/AutomationServices/AutomationServices/uwsgi_params;
    }
}


# nginx.conf file
server {
        listen 80 default_server;
        server_name sjautowebdevn01;
        return 301 https://$server_name$request_uri;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

 error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}
server{
        listen 443 ssl;
        server_name sjautowebdevn01;
        ssl_certificate /etc/nginx/ssl/public.crt;
        ssl_certificate_key /etc/nginx/ssl/private.key;
        location / {
                root /usr/share/nginx/html;
                index index.html index.htm;
        }
}
...