william_0353 2020-07-03 18:52 采纳率: 50%
浏览 95

我的uwsgi + nginx 配置哪里出了问题?

我用django框架在ubuntu 搭建网站。但是目前总是有问题。访问公网ip/域名都是显示nginx欢迎界面
我感觉问题应该在uwsgi.ini 或者 nginx的配置。

麻烦大家帮忙看一下配置问题在哪里?

uwsgi.ini 配置

[uwsgi]
# Django-related settings

socket = 127.0.0.1:8000

# the base directory (full path)
chdir= /home/xing/Desktop/django/
module=  /django/ecommerce.wsgi:application

# process-related settings
# master
master          = true

# maximum number of worker processes
processes       = 4

# ... with appropriate permissions - may be needed
# chmod-socket    = 664
# clear environment on exit
vacuum          = true

daemonize = /home/xing/Desktop/django/uwsgi/uwsgi_log.log

pidfile = /home/xing/Desktop/django/uwsgi/uwsgi_pid.log

nginx配置:

# mysite_nginx.conf

# the upstream component nginx needs to connect to
upstream django {
    server 127.0.0.1:8000; 
}


server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name www.geekpark.nl;
    charset     utf-8;

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

    # Django media
    location /media  {
        alias /home/xing/static/images;  
    }

    location /static {
        alias /home/xing/static; # your Django project's static files - amend as required
        expires 30d;
    }


    location / {
        uwsgi_pass  127.0.0.1:8000;
        include     uwsgi_params; # the uwsgi_params file you installed
    }
}
  • 写回答

1条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥15 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!