zoukankan      html  css  js  c++  java
  • Nginx与uWSGI交互

    1. 更改uwsgi的配置文件uwsgi.ini

    [uwsgi]
    ...
    #使用nginx连接时, 监控地址
    socket=127.0.0.1:8080
    #直接做web服务器时, 所监控地址
    #http=127.0.0.1:8080


    2. 在nginx配置文件中的路由模块添加uwsgi支持.

    sudo vim /usr/local/nginx/conf/nginx.conf

    更改server模块.

        server {
            listen       80;
            server_name  localhost;
            
            location / {
                include uwsgi_params;
                uwsgi_pass localhost:8080;
            }

    nginx配置全文:

     1 worker_processes  1;
     2 events {
     3     worker_connections  1024;
     4 }
     5 http {
     6     include       mime.types;
     7     default_type  application/octet-stream;
     8     sendfile        on;
     9     keepalive_timeout  65;
    10 
    11     server {
    12         listen       80;
    13         server_name  localhost;
    14 
    15         location / {
    16             include uwsgi_params;
    17             uwsgi_pass localhost:8080;
    18         }
    19 
    20         error_page   500 502 503 504  /50x.html;
    21         location = /50x.html {
    22             root   html;
    23         }
    24     }
    25 }
    Nginx配置全文

    3. 重启nginx和uwsgi即可

  • 相关阅读:
    Linux设备管理(一):kobject, kset, ktype分析
    Keepalived高可用集群
    Nginx反向代理与负载均衡
    LNMP环境应用实践
    HTTP协议
    Nginx详解
    MySQL进阶
    MySQL安装与基本使用
    Jumpserver跳板机
    PXE自动化装机
  • 原文地址:https://www.cnblogs.com/jrri/p/11684790.html
Copyright © 2011-2022 走看看