Chinaunix首页 | 论坛 | 博客
  • 博客访问: 82006
  • 博文数量: 21
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 280
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-18 16:08
文章分类

全部博文(21)

文章存档

2016年(2)

2014年(11)

2013年(8)

我的朋友

分类: 系统运维

2014-06-24 11:42:24


    nginx + uwsgi 
  

点击(此处)折叠或打开

  1. user www-data;
  2. worker_processes 4;
  3. worker_rlimit_nofile 102400;
  4. worker_cpu_affinity 00000001 00000010 00000100 00001000;

  5. error_log /var/log/nginx/error.log ;
  6. pid /var/run/nginx.pid;

  7. events {
  8.     use epoll;
  9.     multi_accept on;
  10.     worker_connections 65535;
  11. }


  12. http {
  13.     include /etc/nginx/mime.types;
  14.     default_type application/octet-stream;

  15.     log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  16.                       '$status $body_bytes_sent "$http_referer" '
  17.                       '"$http_user_agent" "$http_x_forwarded_for"';

  18.     access_log /var/log/nginx/access.log main;
  19.     access_log /var/log/nginx/access.log main;

  20.     sendfile on;
  21.     tcp_nopush on;
  22.     tcp_nodelay on;
  23.     

  24.     keepalive_timeout 60;
  25.     client_header_timeout 20;
  26.     client_body_timeout 20;
  27.     reset_timedout_connection on;
  28.     send_timeout 20;
  29.  
  30.     limit_conn_zone $binary_remote_addr zone=addr:10m;

  31.     gzip on;
  32.     gzip_proxied any;
  33.     gzip_min_length 256;
  34.     gzip_comp_level 4;
  35.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

  36.     open_file_cache max=100000 inactive=20s;
  37.     open_file_cache_valid 30s;
  38.     open_file_cache_min_uses 2;
  39.     open_file_cache_errors on;

  40.     #include /etc/nginx/conf.d/*.conf;
  41.     include /etc/nginx/sites-enabled/*.conf;
  42. }



点击(此处)折叠或打开

  1. server {
  2.         listen 80;
  3.         server_name ####.####.net;
  4.         access_log /var/log/nginx/###.access.log;
  5.         error_log /var/log/nginx/###.error.log;
  6.         charset utf-8;

  7.         location / {
  8.              include uwsgi_params;
  9.              uwsgi_pass unix://///run/uwsgi/app/###/socket;
  10.     
  11.         }


  12.         location /static{
  13.              alias /WebApps/uwsgi/###/static;
  14.              index index.html index.htm;
  15.         }

  16. }


阅读(1067) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~