記錄一下在ubuntu 上配置nginx+uwsgi+flask出現的一點問題.

尚未解決html

 

如今的狀況很奇怪,nginx

配置uwsgi經過啓動腳本啓動後,沒法正常運行,相同代碼在centos上徹底沒有問題,一樣用的是venv的環境,ubuntu

ubuntu,貼上nginx配置和uwsgi配置centos

uwsgi.inibash

[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文件重載後,鏈路被摧毀了.具體還在找緣由

 

 

  nginxsession

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;
}

  

 

嘗試修改測試環境:app

inisocket

能夠實時載入修改的py....感受也挺危險的..測試

仍是喜歡用 reload指令,生產環境不敢亂動..spa

 

 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
相關文章
相關標籤/搜索