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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题