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即可

  • 相关阅读:
    心血来潮学python
    lua中的table、stack和registery
    wrapper for lua
    FT232RL变砖之后
    12.04 redmine
    Webpack 概念
    如何学习 Webpack
    React基础篇
    Intellij实用技巧
    一行代码搞定图片缩放、旋转、加水印
  • 原文地址:https://www.cnblogs.com/jrri/p/11684790.html
Copyright © 2011-2022 走看看