gunicorn +nginx+python3 部署flask项目(gevent+gevent)--依赖的包

  1. 云栖社区>
  2. 博客>
  3. 正文

gunicorn +nginx+python3 部署flask项目(gevent+gevent)--依赖的包

嘟囔 2019-11-05 09:57:50 浏览525

gunicorn +nginx+python3 部署(gevent+gevent)--依赖的包

bind = ["0.0.0.0:5010"]
workers = 4
backlog = 2048
worker_class = 'gevent'
forwarded_allow_ips = "*"
keepalive = 5
timeout = 300
worker_connections = 65535
loglevel = "info"
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
accesslog = '/root/tv/tv_api/zhijian_tv_api/gunicorn_access.log'
errorlog = '/root/tv/tv_api/zhijian_tv_api/gunicorn_error.log'

运行命令----gunicorn -c gunicorn_conf.py manager:app -D

nginx.conf ----不动

nginx/conf.d 
 server {
               listen 80;
               server_name max-tv.net.cn, www.max-tv.net.cn;
               return 301 https://www.max-tv.net.cn$request_uri;
       }
      server {
              listen 443 ssl;
              server_name www.max-tv.net.cn;
              ssl_certificate /etc/nginx/ssl_h5/2425677_max-tv.net.cn.pem;
              ssl_certificate_key /etc/nginx/ssl_h5/2425677_max-tv.net.cn.key;
              root /usr/share/nginx/html; 
              location / {
              root /root/newProject/h5newproject/dist;
              index index.html index.htm list.html MP_verify_zseh73X5od2vmgWX.txt;
              try_files $uri $uri/ /index.html; 
              }
        location /api/share/ {
            error_page 404 /404.html;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_pass http://sharing;
              error_page 500 502 503 504 /50x.html;} 
      }
        upstream sharing {
          server 39.98.188.73:5011 fail_timeout=0;
      }