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

Nginx与uWSGI交互

时间:2019-10-16 13:11:52      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:play   isp   location   nec   keep   支持   pre   sudo   file   

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

Nginx与uWSGI交互

标签:play   isp   location   nec   keep   支持   pre   sudo   file   

原文地址:https://www.cnblogs.com/jrri/p/11684790.html

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