配置好后,输入网址依旧显示welcome to centos
来源:17-7 uwsgi和nginx配置
qq_屈若松_HNXZ48
2020-07-03
uc_nginx.conf
在这里输入代码
# the upstream component nginx needs to connect to
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:8000; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name 47.100.234.115; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /root/Django_project/media; # 指向django的media目录
}
location /static {
alias /root/Django_project/static; # 指向django的static目录
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include uwsgi_params; # the uwsgi_params file you installed;
}
}
在这里输入代码
# mysite_uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /root/Django_project
# Django's wsgi file
module = Django_project.wsgi
# the virtualenv (full path)
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = 127.0.0.1:8000
# ... with appropriate permissions - may be needed
# chmod-socket = 664
# clear environment on exit
vacuum = true
virtualenv = /root/.virtualenvs/wdnc
;logto = /tmp/mylog.log
;注:
;;chdir: 表示需要操作的目录,也就是项目的目录
;;module: wsgi文件的路径
;;processes: 进程数
;;virtualenv:虚拟环境的目录
;;
;;
;;workon mxonline
;;uwsgi -i 你的目录/Mxonline/conf/uwsgi.ini &
服务也都启动了
uwsig这边没有反应
写回答
1回答
-
bobby
2020-07-05
uc_nginx.conf文件你放在哪里的? 截图我看看
是否重启过nginx?
浏览器是否通过47.100.234.115访问的?
022020-07-07
相似问题