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. Python:从入门到实践--第五章--if语句--练习

    #1.编写一系列条件测试:将每个测试以及结果打印出来 car = '宝马' if car == "宝马": print("预测正确") print(car) e ...

  2. 装了anaconda之后如何设置anaconda、python环境变量

    装了anaconda之后如何设置anaconda.python环境变量 1.装了anaconda之后如何设置anaconda环境变量 参考 https://www.cnblogs.com/avivi/ ...

  3. es6去重

    // set是一种新的数据结构,它可以接收一个数组或者是类数组对象,自动去重其中的重复项目. var arr=[9,9,"丸子","丸子",undefined, ...

  4. 关于mdb数据库在插入过程中报错->Syntax error in INSERT INTO statement.(sql语句没问题)

    今天,在做mdb数据库的增删改查的时候,代码报错插入语句有问题,但是在数据库中正常执行,苦苦探索了多次,终于找到了问题所在. 结果如图: 上面是报错 下面是解决方案   解决方案:主要原因是offic ...

  5. webpack打包和gulp打包工具详细教程

    30分钟手把手教你学webpack实战 阅读目录 一:什么是webpack? 他有什么优点? 二:如何安装和配置 三:理解webpack加载器 四:理解less-loader加载器的使用 五:理解ba ...

  6. git push 不想把本地某个目录下文件上传的办法

  7. Javascript 3.2

    对象的三种类型:1.用户定义对象:程序员自己创建的对象 2.内建对象:Javascript语言中的固定对象,如Array/Math/Data等 3.宿主对象:由浏览器提供的对象 BOM:浏览器对象模型 ...

  8. IDEA中的version control问题

    项目已经添加了svn,但右键项目时找不到Svn选择.但在VCS中却有,很奇怪. 这个问题是svn的根路径与当前IDEA打开的项目路径不一致的原因. 在IdeaProjects下有两个项目,一个inju ...

  9. python padas 学习

    import matplotlib from pandas import DataFrame import numpy as np import pandas as pd import MySQLdb ...

  10. Android项目——触摸按键控制LED

    一.Android Studio应用编程 1.应用程序界面layout对应的界面是activity_main.xml,后台对应的java文件是MainActivity.java,修改activity_ ...