zoukankan      html  css  js  c++  java
  • uwsgi部署

    一、安装uwsgi

    pip install uwsgi

    二、编写uwsgi.ini

    # mysite_uwsgi.ini file
    [uwsgi]
    daemonize = /website/AutocareBaoLei/uwsgi.log
    logto = /website/AutocareBaoLei/error.log
    socket = :8000
    chdir = /website/AutocareBaoLei
    module = AutocareBaoLei.wsgi
    master = true
    process = 4
    vacuum = true

    三、启动uwsgi

    uwsgi --ini /etc/uwsgi.ini

    四、nginx配置文件

    upstream wsbackend {
            server 127.0.0.1:8000;
        }
    
        server {
            listen       80;
            server_name  www.xxx.com;
            root         /website/AutocareBaoLei;
    
            # Load configuration files for the default server block.
            include /etc/nginx/default.d/*.conf;
    
            location /static/ {
            alias /website/AutocareBaoLei/static/;
            }
    
            location /media/ {
            alias /website/AutocareBaoLei/media/;
            }
    
            location / {
                include uwsgi_params;
                uwsgi_pass wsbackend;
            }
    
            location /webssh/ {
                proxy_pass http://127.0.0.1:8080/webssh/;
                proxy_redirect off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header Host $host;
            }
    
            error_page 404 /404.html;
                location = /40x.html {
            }
    
            error_page 500 502 503 504 /50x.html;
                location = /50x.html {
            }
        }
  • 相关阅读:
    使用 GitHub, Jekyll 打造自己的免费独立博客
    如何解决数据科学计数法在数据库中的显示
    RDF
    C# 在 4.0 以后一共有3种创建线程的方式
    C#多线程
    1、框架概述
    3、IDEA 中使用 Maven
    2、Maven 核心概念
    1、Maven 概述
    JDK动态代理
  • 原文地址:https://www.cnblogs.com/lee-xingxing/p/11046987.html
Copyright © 2011-2022 走看看