还没有解决
现在的情况很奇怪,
配置uwsgi通过启动脚本启动后,无法正常运行,相同代码在centos上完全没有问题,同样用的是venv的环境,
ubuntu,贴上nginx配置和uwsgi配置
uwsgi.ini
[uwsgi] socket = 127.0.0.1:8001 wsgi-file=/home/rod/www/app.py callable=app touch-reload=/home/rod/www/ daemonize=/home/rod/uwsgi.log pidfile= /home/rod/www/uwsgi.pid processes = 1 threads = 2 stats = 127.0.0.1:9191l
即使手动启动好服务后....可以访问网页.但是但是但是只要修改py文件重载后,链路被摧毁了.具体还在找原因
nginx
server { listen 443 ssl; ssl on; server_name xxxxx; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; ssl_certificate /home/rod/xxxxx,crt; ssl_certificate_key /home/rod/xxxxx.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:8001; uwsgi_param UWSGI_PYHOME /home/rod/www/env; uwsgi_param UWSGI_CHDIR /home/rod/www; uwsgi_param UWSGI_SCRIPT mohu:mohu; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } server { listen 80; server_name xxxxx; rewrite ^(.*)$ https://$host$1 permanent; }
尝试修改测试环境:
ini
可以实时载入修改的py....感觉也挺危险的..
还是喜欢用 reload指令,生产环境不敢乱动..
1 [uwsgi] 2 master =true 3 socket = 127.0.0.1:8181 4 vacuum = true 5 chdir=/home/rod/www 6 wsgi-file=/home/rod/www/app.py 7 callable=app 8 #touch-reload=/home/rod/www 9 daemonize=/home/rod/uwsgi.log 10 pidfile= /home/rod/uwsgi.pid 11 processes = 1 12 threads = 2 13 enable-threads = true 14 stats = 127.0.0.1:9191 15 py-autoreload = 1
原文地址:https://www.cnblogs.com/rodzheng/p/9943482.html
时间: 2024-10-11 23:20:09