码迷,mamicode.com
首页 > 其他好文 > 详细

flask +uwsgi +nginx

时间:2020-12-25 12:32:53      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:www   pes   ssl   out   process   master   mon   静态   nginx   

uwsgi

?

#添加配置选择
[uwsgi]
http=:5000
#配置和nginx连接的socket连接

socket = 127.0.0.1:8001
#配置项目路径,项目的所在目录
chdir=/data/wwwroot/爱家/iHome-python
#配置wsgi接口模块文件路径,也就是wsgi.py这个文件所在的目录名
wsgi-file=/data/wwwroot/爱家/iHome-python/manage.py
callable=app
vacuum = true
#配置启动的进程数
processes=4
#配置每个进程的线程数
threads=2
#配置启动管理主进程
master=True
#配置存放主进程的进程号文件
pidfile=uwsgi.pid
#配置dump日志记录
daemonize=uwsgi.log
;
;[uwsgi]
;
;http=:5000
;
;socket = 127.0.0.1:8001
;
;wsgi-file=/data/wwwroot/爱家/iHome-python/manage.py
;
;callable=app
;
;processes=4
;
;threads=2
;
;stats = 127.0.0.1:9191
;
;vacuum = true

nginx

events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    server {
        	listen 80;
        	server_name  aaa.520ln.club; #改为自己的域名,没域名修改为127.0.0.1:80
        	charset utf-8;   
        	location / {
           	include uwsgi_params;
           	uwsgi_pass 127.0.0.1:8001;  #端口要和uwsgi里配置的一样
           	uwsgi_param UWSGI_SCRIPT manage:manage;  #wsgi.py所在的目录名+.wsgi
           	uwsgi_param UWSGI_CHDIR /data/wwwroot/爱家/iHome-python/; #项目路径
           
        }
        	location /static/ {
        		alias /data/wwwroot/爱家/iHome-python/ihome/static/; #静态资源路径
        }
    }
}




#events {
#    worker_connections  1024;
#}
#http {
#    include       mime.types;
#    default_type  application/octet-stream;
#    sendfile        on;
#    server {
#	     listen       443 ssl;
#	     server_name  ccc.520ln.club;
#	     root html;
#          index index.html index.htm;
#
#	     ssl_certificate 		/usr/local/nginx/cert/1_www.olbbaby.xyz_bundle.crt;
#	     ssl_certificate_key 	/usr/local/nginx/cert/2_www.oldbaby.xyz.key; 
#	     
#	     ssl_session_timeout 5m;
#	     
#	     ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
#	     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
#	    	ssl_prefer_server_ciphers on;
#	   	location / {
#	      	include uwsgi_params;
#	      	uwsgi_pass 127.0.0.1:8001;  #端口要和uwsgi里配置的一样
#	      	uwsgi_param UWSGI_SCRIPT manage:manage;  #wsgi.py所在的目录名+.wsgi
#	      	uwsgi_param UWSGI_CHDIR /data/wwwroot/爱家/iHome-python/; #项目路径
#	      
#	   }
#	   	location /static/ {
#	   		alias /data/wwwroot/爱家/iHome-python/ihome/static/; #静态资源路径
#	   }
#   }
#   server {
#	  listen 80;
#	  server_name ccc.520ln.club;
#	  return 301 https://$server_name$request_uri;
#	}
#}

#
#events {
#    worker_connections  1024;
#}
#http {
#    include       mime.types;
#    default_type  application/octet-stream;
#    sendfile        on;
#    server {
#        listen 443 ssl ;
#        server_name  ccc.520ln.club;
#        root /data/wwwroot/爱家/iHome-python/;
#        charset utf-8;
#        ssl_certificate    /1.crt;#.pem证书路径
#        ssl_certificate_key  /2.key;#.key证书路径
#        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
#        ssl_prefer_server_ciphers on;
#        ssl_session_cache shared:SSL:10m;
#        ssl_session_timeout 10m;
#        error_page 497  https://$host$request_uri;
#        location / {
#	      	include uwsgi_params;
#	      	uwsgi_pass 127.0.0.1:8001;  #端口要和uwsgi里配置的一样
#	      	uwsgi_param UWSGI_SCRIPT manage:manage;  #wsgi.py所在的目录名+.wsgi
#	      	uwsgi_param UWSGI_CHDIR /data/wwwroot/爱家/iHome-python/; #项目路径
#	      
#	   }
#	   	location /static/ {
#	   		alias /data/wwwroot/爱家/iHome-python/ihome/static/; #静态资源路径
#	   }
#}
#}

flask +uwsgi +nginx

标签:www   pes   ssl   out   process   master   mon   静态   nginx   

原文地址:https://www.cnblogs.com/ln-xxx/p/14166340.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!