Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.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 gunicorn未在端口80上运行_Django_Ubuntu_Amazon Web Services_Nginx_Gunicorn - Fatal编程技术网

django项目的nginx gunicorn未在端口80上运行

django项目的nginx gunicorn未在端口80上运行,django,ubuntu,amazon-web-services,nginx,gunicorn,Django,Ubuntu,Amazon Web Services,Nginx,Gunicorn,我正在为django应用程序设置一个生产服务器。我能够在nginx和gunicorn的帮助下运行它。问题是,当我在8000或8001端口上运行它时,它工作正常。但当我在端口80上运行它时,它没有连接。这是我在命令行中使用的命令: gunicorn abcd.wsgi:application-bind=0.0.0.0:80不工作 gunicorn abcd.wsgi:application-bind=0.0.0.0:8000正在工作 因此,当我在浏览器中打开我的网站时,我必须给出端口号,例如-ab

我正在为django应用程序设置一个生产服务器。我能够在nginx和gunicorn的帮助下运行它。问题是,当我在8000或8001端口上运行它时,它工作正常。但当我在端口80上运行它时,它没有连接。这是我在命令行中使用的命令:

gunicorn abcd.wsgi:application-bind=0.0.0.0:80不工作

gunicorn abcd.wsgi:application-bind=0.0.0.0:8000正在工作 因此,当我在浏览器中打开我的网站时,我必须给出端口号,例如-abcd.com:8000

命令的输出为:

1. netstat -tulpn | grep :80

   tcp    0    0.0.0.0:80    0.0.0.0:*    LISTEN    27506/nginx
nginx conf文件是:

 server {
    listen 80; 
    server_name abcd.com;
    location / { 
       proxy_pass http://0.0.0.0:8000;
    }

location /static/ {
    alias /home/ubuntu/staticvirt/test_project/staticfiles/;
   }
}

你做得对。只需运行:gunicorn abcd.wsgi:application-bind=0.0.0.0:8000,然后在您的url中键入abcd.com,您的gunicorn将与ngnix绑定,gunicorn将在8000端口运行,ngnix将在80端口运行。请回答@SubodhDeoli。如果你把你所说的一切都不起作用的错误包括在内,那会有所帮助。这不是答案。。。我发出的命令是错误的。我使用了@Yogesh-answer,效果非常好。。