Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django &引用;“上游”;来自nginx的错误。。。can';我想不出来_Django_Nginx_Amazon Ec2_Uwsgi - Fatal编程技术网

Django &引用;“上游”;来自nginx的错误。。。can';我想不出来

Django &引用;“上游”;来自nginx的错误。。。can';我想不出来,django,nginx,amazon-ec2,uwsgi,Django,Nginx,Amazon Ec2,Uwsgi,尝试启动nginx时出现以下错误: /$sudo nginx-t 在/etc/nginx/sites enabled/catalog\u nginx.conf:4中不允许使用nginx:[emerg]“上游”指令 我的应用程序根目录中有一个文件“catalog\u nginx.conf”: # catalog_nginx.conf # the upstream component nginx needs to connect to upstream django { #server u

尝试启动nginx时出现以下错误:

/$sudo nginx-t

在/etc/nginx/sites enabled/catalog\u nginx.conf:4中不允许使用nginx:[emerg]“上游”指令

我的应用程序根目录中有一个文件“catalog\u nginx.conf”:

# catalog_nginx.conf

# the upstream component nginx needs to connect to
upstream django {
    #server unix:///home/ec2-user/catalog/catalog.sock; # production
    server 127.0.0.1:8001; # testing
}

# configuration of the server
server {
    listen  8000;
    server_name 54.redacted; 
    charset     utf-8;

    # max upload size
    client_max_body_size 75M;

    # Django media
    location /media  {
        alias /home/ec2-user/catalog/media/;  # media files
    }

    location /static {
        alias /home/ec2-user/catalog/static/; # static files
    }

    # all non-media requests
    location / {
    uwsgi_pass  django;
        include     /home/ec2-user/catalog/uwsgi_params; 
    }
}
在/etc/nginx/I的'nginx.conf'文件中,在http{}下有以下内容

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;
我已将这两个文件进行了符号链接


想法?

显示文件的基础部分可能有用。这是否有帮助:显示文件的基础部分可能有用。这是否有帮助: