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配置的更多相关文章

  1. 快速部署Python应用:Nginx+uWSGI配置详解

    在PHP里,最方便的就是deployment了,只要把php文件丢到支持PHP的路径里面,然后访问那个路径就能使用了:无论给主机添加多少PHP应用,只要把目录改好就没你的事了,完全不用关心php-cg ...

  2. Nginx + uWSGI 配置django---终极版

    好开森,配置了差不多一天的项目,终于成功了,写一篇博客庆祝一下 我们先来了解下nginx与uwsgi的概念,再去配置 磨刀不误砍柴工. nginx 是一个开源的高性能的 HTTP 服务器和反向代理:1 ...

  3. nginx + uwsgi 配置参考

    参考 http://www.runoob.com/django/django-nginx-uwsgi.html ####### 20181029 cd ~wget http://python.org/ ...

  4. 使用Nginx+uwsgi在亚马逊云服务器上部署python+django项目完整版(二)——部署配置及相关知识

    ---恢复内容开始--- 一.前提: 1.django项目文件已放置在云服务器上,配置好运行环境,可正常运行 2.云服务器可正常连接 二.相关知识 1.python manage.py runserv ...

  5. ubuntu配置Python-Django Nginx+uwsgi 安装配置

    安装Nginx sudo apt-get install nginx ubantu安装完Nginx后,文件结构大致为: 所有的配置文件都在 /etc/nginx下: 启动程序文件在 /usr/sbin ...

  6. Nginx+uwsgi+Django 的web应用环境部署-完整记录

    Python作为当前最火爆最热门,也是最主要的Web开发语言之一,在其二十多年的历史中出现了数十种Web框架,比如Django.Tornado.Flask.Twisted.Bottle和Web.py等 ...

  7. Nginx+uwsgi安装配置

    一.安装基础开发包 yum groupinstall "Development tools" yum install zlib-devel bzip2-devel pcre-dev ...

  8. Django Nginx+uwsgi 安装配置

    使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,我们需要一个可以稳定而持续的服务器,比如apache, Nginx, lighttp ...

  9. Flask+Nginx+uWSGI在Ubuntu服务器上的配置

    Flask+Nginx+uWSGI在Ubuntu服务器上的配置 Step1 安装系统环境 Ubuntu服务器选择是阿里云的ECS服务,ECS提供单独的内存\CPU\带宽\存储规格可以选择,并且提供合适 ...

随机推荐

  1. 易语言Dns缓存

    一些与DNS解析有关的命令: ipconfig/displaydns   -查看被缓存的域名解析 ipconfig/flushdns     -清空DNS缓存 .版本 .DLL命令 DnsFlushR ...

  2. django(channel)到 ubuntu

    1.准备工作 删除各app/migrations/下的以数字开头的数据库同步日志文件: 假设你使用的是Pycharm,我们要生成环境包: pip freeze > requirements.tx ...

  3. 1077 Eight

    Eight Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37738   Accepted: 15932   Special ...

  4. 报错【org.springframework.validation.BeanPropertyBindingResult】

    报错内容:org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'price ...

  5. Day01_Python学习今日收获

    1.关键字 break:终止本层循环,即如果是双层嵌套循环,那么就终结最内层循环 注意:如果在for或while循环中终止,他们任何对应的else语句块也将不执行. 2.关键字continue:跳过当 ...

  6. linux 中 修改权限的命令 chmod

    今天被这个命令给黄了, 连这个都记不住,是该好好的复习复习了,问了一个问题,就是说这个tomcat 如何去修改关于这个权限的问题:一下子把我弄蒙了,不说了,心累: 修改linux文件权限命令:chmo ...

  7. canvas绘制随机验证码

    效果图: 思路: 1, 绘制canvas画布,进行基础设置 2.绘制一个矩形 3.设置验证码的随机数 4.设置验证码随机数的随机颜色 5.绘制随机干扰线 6,绘制随机干扰点 经过以上六个步骤,验证码的 ...

  8. 给PostgreSQL添加MySQL的unix_timestamp与from_unixtime函数

    MySQL的2个常用函数unix_timestamp()与from_unixtime PostgreSQL并不提供,但通过PostgreSQL强大的扩展性可以轻松的解决问题. 话说远在天边,尽在眼前, ...

  9. Netty 基本组件与线程模型

    Netty 的学习内容主要是围绕 TCP 和 Java NIO 这两个点展开的,由于 Netty 是基于 Java NIO 的 API 之上构建的网络通讯框架,Java NIO 中的几个组件,都能在 ...

  10. 学习Linux的软件管理、进程管理

    一.软件管理 1.使用yum管理软件安装包 1.1什么是yum Yum (全称为:Yellow dog Updater, Modified) 由Duke University团队,修改Yellow D ...