我用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
}
}