配置好后,输入网址依旧显示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

  1. uc_nginx.conf文件你放在哪里的? 截图我看看

  2. 是否重启过nginx?

  3. 浏览器是否通过47.100.234.115访问的?

0
2
bobby
回复
qq_屈若松_HNXZ48
配置文件应该放到nginx配置文件夹下面的conf.d目录下 你是放到这里吗 截图我看看放的位置 nginx你是如何启动的?
2020-07-07
共2条回复

Django+ xadmin 开发在线教育网站

一套通用的技术组合拳,助你解决大部分Python类网站后端问题

1911 学习 · 2149 问题

查看课程