Nginx与python web服务配置(Uwsgi& FastCGI)
Uwsgi
- start uswgi
uwsgi --harakiri 360000 --body-read-warning=10000 --max-fd=65536 -b 1000000 --http-buffer-size=65536 --post-buffering 8192 --post-buffering-bufsize=65536 -p 10 --threads 20 -s 10.10.192.63:8082 -w app:app -d /application/search/log/uws_gi.log
- nginx setting
upstream uwsgi_host {
server 10.10.192.63:8082;
server 10.10.192.64:8082;
}
#gzip on;
server {
listen 8081;
server_name localhost;
location /static {
alias /uwsgi/myenv/myproject/static;
}
location / {
client_max_body_size 61440m;
proxy_send_timeout 36000;
proxy_read_timeout 36000;
proxy_connect_timeout 36000;
proxy_buffer_size 512k;
proxy_buffers 64 128k;
proxy_busy_buffers_size 1024k;
proxy_temp_file_write_size 512k;
include uwsgi_params;
uwsgi_pass uwsgi_host;
}
error_page 404 /404.html;
}
FastCGI And Django
- make a django project then run it
python manage.py runfcgi method=prefork host=127.0.0.1 port=9000 pidfile=/var/run/ django.pid
- nginx setting
server {
server_name .website.com;
listen 80;
root /home/website/www;
index index.html;
location / {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
}
Nginx与python web服务配置(Uwsgi& FastCGI)的更多相关文章
- 2-4、nginx特性及基础概念-nginx web服务配置详解
Nginx Nginx:engine X 调用了libevent:高性能的网络库 epoll():基于事件驱动event的网络库文件 Nginx的特性: 模块化设计.较好扩展性(不支持模块动态装卸载, ...
- 生产环境中nginx既做web服务又做反向代理
一.写对于初入博客园的感想 众所周知,nginx是一个高性能的HTTP和反向代理服务器,在以前工作中要么实现http要么做反向代理或者负载均衡.尚未在同一台nginx或者集群上同时既实现HTTP又实现 ...
- Python Web 程序使用 uWSGI 部署
Python Web 程序使用 uWSGI 部署 WSGI是什么? WSGI,全称 Web Server Gateway Interface,或者 Python Web Server Gateway ...
- 戏说WSGI(Python Web服务网关接口)--[转载]
戏说WSGI(Python Web服务网关接口) 当你在Python的世界中冒险,突然遭遇一只Web怪兽,你会选择什么武器对付它?在兵器谱上,下列兵器可谓名列前茅: Zope,厚重的长枪.较早出现的武 ...
- Python Web 服务开发者: 第 1 部分
Python Web 服务开发者: 第 1 部分 Python Web 服务世界 Python 的座右铭一向是“装备齐全”,这是指在安装该语言时会附带一大套标准库和功能程序.本文概述了在 Python ...
- 使用uwsgi 部署python web服务
uwsgi, wsgi协议的一个很好的实现,源码在这里:https://github.com/unbit/uwsgi c语言编写,有兴趣可以研究下. 上DEMO: wsgi_server.py def ...
- Windows下搭建Apache+Django+Python Web服务环境
最近在学Django,想用Apache搭建一个服务器环境,因此在网上看了好多资料,很多都是用Python2.6和Apache2.2搭建的环境,不过我还是想用Python35和Apache24来搭建,具 ...
- windows + myeclipse 调试 linux + tomcat 的java web服务 配置方式
一.linux tomcat配置和启动 1.catalina.sh第一行加入 declare -x CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt ...
- redhat enterprixe 5.0 web 服务配置与管理
一.Web服务及工作原理 Web服务的实现采用客户/服务器模型.客户机运行Web客户程序(浏览器),作用是解释和显示Web页面,相应用户的输入请求,并且通过http协议将用户请求传递给Web服务器.W ...
随机推荐
- Generating Palindromes LightOJ - 1033
Generating Palindromes LightOJ - 1033 题意:添加最少的字符使得给出的字符串成为回文串.输出添加的字符数. 方法:常规区间dp.ans[i][j]表示使得ans[i ...
- 514 Freedom Trail 自由之路
详见:https://leetcode.com/problems/freedom-trail/description/ C++: class Solution { public: int findRo ...
- 160 Intersection of Two Linked Lists 相交链表
编写一个程序,找到两个单链表相交的起始节点.例如,下面的两个链表:A: a1 → a2 ↘ ...
- 【转】grep 用法详解
有时会使用到,但老忘,转到博客以便学习收藏 转自http://blog.csdn.net/tenfyguo/article/details/6387786 首先要记住的是: 正则表达式与通配符不一样, ...
- winform 打印小票
后台代码 panPrintContent.Visible = true; var strlPrinterMode = ""; ; ; ; ; panPrintContent.Vis ...
- linux小白成长之路12————Docker部署Nginx
[内容指引] Docker安装Nginx: 简单启动: 准备配置文件: 一.Docker安装Nginx 指令:docker pull nginx 二.简单启动 指令:docker run --name ...
- 8.bootstrap下拉菜单、按钮组、按钮式下拉菜单
下拉菜单 dropdown 对齐方式: .dropdown-menu-right .dropdown-menu-left <div class="container" ...
- TCAM 与CAM
CAM是Content Addressable Memory的缩写,即"内容寻址存储器"的意思,它是在传统的存储技术的基础上实现的联想记忆存储器,关于CAM的基本操作有三种: 1) ...
- JD IPO address by liuqiangdong
Ladies and gentlemen, Good evening.I'd rather use english, not mandarin.Because during the road show ...
- 第8章 应用协议 图解TCP/IP 详解
第8章 应用协议 图解TCP/IP 详解 8.1 应用层协议概要 应用层协议的定义 TCP和IP等下层协议是不依赖上层应用类型.实用性非常广的协议.而应用协议则是为了实现某种应用而设计和创造的协议. ...