nginx+uwsgi配置
nginx
#user nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on; server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} server {
listen 8001;
server_name localhost;
charset utf-8;
client_max_body_size 75M; # adjust to taste
#location /media {
# alias /opt/my_project/projects/jingdong/media; # 指向django的media目录
# }
location /static {
alias /opt/my_project/projects/static; # 指向django的static目录 }
# access_log /var/log/nginx/access.log; #配置log文件,自动生成 # error_log /var/log/nginx/error.log; location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9006; #此处要与uwsgi中socket所配置的一致 uwsgi_read_timeout 2; }
} }
uwsgi
[uwsgi] # Django-related settings
# the base directory (full path)
chdir = /opt/my_project/projects
# Django's wsgi file
module = jingdong.wsgi
# the virtualenv (full path) # process-related settings
# master
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = 127.0.0.1:9006 #此处的socket的配置需要与nginx的uwsgipass一样
# ... with appropriate permissions - may be needed
# chmod-socket = 664
# clear environment on exit
vacuum = true
logto = /opt/my_project/projects/logs/jingdong.log
nginx+uwsgi配置的更多相关文章
- 快速部署Python应用:Nginx+uWSGI配置详解
在PHP里,最方便的就是deployment了,只要把php文件丢到支持PHP的路径里面,然后访问那个路径就能使用了:无论给主机添加多少PHP应用,只要把目录改好就没你的事了,完全不用关心php-cg ...
- Nginx + uWSGI 配置django---终极版
好开森,配置了差不多一天的项目,终于成功了,写一篇博客庆祝一下 我们先来了解下nginx与uwsgi的概念,再去配置 磨刀不误砍柴工. nginx 是一个开源的高性能的 HTTP 服务器和反向代理:1 ...
- nginx + uwsgi 配置参考
参考 http://www.runoob.com/django/django-nginx-uwsgi.html ####### 20181029 cd ~wget http://python.org/ ...
- 使用Nginx+uwsgi在亚马逊云服务器上部署python+django项目完整版(二)——部署配置及相关知识
---恢复内容开始--- 一.前提: 1.django项目文件已放置在云服务器上,配置好运行环境,可正常运行 2.云服务器可正常连接 二.相关知识 1.python manage.py runserv ...
- ubuntu配置Python-Django Nginx+uwsgi 安装配置
安装Nginx sudo apt-get install nginx ubantu安装完Nginx后,文件结构大致为: 所有的配置文件都在 /etc/nginx下: 启动程序文件在 /usr/sbin ...
- Nginx+uwsgi+Django 的web应用环境部署-完整记录
Python作为当前最火爆最热门,也是最主要的Web开发语言之一,在其二十多年的历史中出现了数十种Web框架,比如Django.Tornado.Flask.Twisted.Bottle和Web.py等 ...
- Nginx+uwsgi安装配置
一.安装基础开发包 yum groupinstall "Development tools" yum install zlib-devel bzip2-devel pcre-dev ...
- Django Nginx+uwsgi 安装配置
使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,我们需要一个可以稳定而持续的服务器,比如apache, Nginx, lighttp ...
- Flask+Nginx+uWSGI在Ubuntu服务器上的配置
Flask+Nginx+uWSGI在Ubuntu服务器上的配置 Step1 安装系统环境 Ubuntu服务器选择是阿里云的ECS服务,ECS提供单独的内存\CPU\带宽\存储规格可以选择,并且提供合适 ...
随机推荐
- vue 打印功能
printContent (e) { let subOutputRankPrint = document.getElementById('subOutputRank-print') console.l ...
- python--sort()和sorted()高级排序
1.list中的sort()方法: def sort(self, key=None, reverse=False): # real signature unknown; restored from _ ...
- 关于indexof和substring经常记不住的点
indexof 找到的字符位置是 字符串从0位开始算起的. lastIndexOf也一样,http://localhost:8080/aaa,的lastIndexOf("/")是2 ...
- mybatis 源码分析一
1.SqlSessionFactoryBuilder public SqlSessionFactory build(InputStream inputStream, String environme ...
- 【算法导论】【排序】—— 计数排序(counting sort)
计数排序的特点: 需要额外的数组以存储: 中间过程数据(记为数组 C),数组 C 的下标是待排序序列的元素值,下标对应的值为出现的次数: 排序后的序列(记为 B),计数排序仅获取原始待排序序列的值,对 ...
- phoneshop cs6破解
一.以“试用”方式安装photoshop: 二.下载amtlib.dll破解文件,密码:ubx2: 三.备份photoshop目录下的amtlib.dll文件,将下载的amtlib.dll文件拷贝到p ...
- 2018上C语言程序设计(高级)作业- 第4次作业成绩及总结
作业地址 https://edu.cnblogs.com/campus/hljkj/CS2017-01/homework/1842 评分准则 第4次作业各项成绩包括三项: 完成WC项目:60分:基本功 ...
- 【EMV L2】终端风险管理(Terminal Risk Management)
终端风险管理使大额交易联机授权,并确保芯片交易能够周期性地进行联机以防止在脱机环境中也许无法察觉的风险. 虽然发卡行被强制要求在应用交互特征(AIP)中将终端风险管理位设置成1以触发终端风险管理,但终 ...
- HDU - 5833: Zhu and 772002 (高斯消元-自由元)
pro:给定N个数Xi(Xi<1e18),保证每个数的素因子小于2e3:问有多少种方案,选处一些数,使得数的乘积是完全平方数.求答案%1e9+7: N<300; sol:小于2e3的素数只 ...
- Go爬去以太坊的价格数据
package main import ( "encoding/json" "errors" "fmt" "io/ioutil&q ...