【发布时间】:2023-03-17 00:59:01
【问题描述】:
这是 uwsgi 配置:
[uwsgi]
uid = 500
listen=200
master = true
profiler = true
processes = 8
logdate = true
socket = 127.0.0.1:8000
module = www.wsgi
pythonpath = /root/www/
pythonpath = /root/www/www
pidfile = /root/www/www.pid
daemonize = /root/www/www.log
enable-threads = true
memory-report = true
limit-as = 6048
这是 Nginx 配置:
server{
listen 80;
server_name 119.254.35.221;
location / {
uwsgi_pass 127.0.0.1:8000;
include uwsgi_params;
}
}
django 工作正常,但是除非我重新启动 uwsgi,否则无法看到修改的页面。(此外,当我配置 8 个工作进程时,当我按下 ctrl+f5 一会儿时,我可以看到修改后的页面,似乎只有特定的worker可以读取和响应修改后的页面,而其他的只是显示旧的,谁缓存了旧的页面?我没有配置任何关于缓存的东西)
我没有配置django,它与“python manager runserver ...”配合得很好,但是在使用nginx+uwsgi时会出现这个问题。
(nginx和uwsgi都是新安装的,我确定这里没有配置其他东西..)
【问题讨论】:
-
这是预期的行为,Apache(例如在嵌入式模式下)的行为类似。