user webroot;
worker_processes 4; worker_cpu_affinity 1000 0100 0010 0001; worker_rlimit_nofile 65506; error_log /opt/nginx/logs/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info; pid /opt/nginx/logs/nginx.pid; events {
worker_connections 65506;
} 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 /opt/nginx/logs/access.log main; sendfile on;
#tcp_nopush on; server_tokens off;
#keepalive_timeout 0;
keepalive_timeout 65;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k; gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on; # Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
#include /etc/nginx/conf.d/*.conf;
server {
listen 8001;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root /home/webroot;
index index.php index.html index.htm;
} location ~ \.php$ {
root /home/webroot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
} error_page 404 /404.html;
location = /404.html {
root /opt/nginx/html-error;
} # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /opt/nginx/html-error;
} } server {
listen 443;
server_name www.soulct.cn; if ($scheme = http) {
return 301 https://$server_name$request_uri; ##访问http跳转到https
} ssl on;
ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9091;
access_log off;
}
location ~ ^/static/ { #配置静态文件
root /data/django_project/blogproject;
expires 24h;
access_log off;
} }
server {
listen 4433;
server_name www.soulct.cn; if ($scheme = http) {
return 301 https://$server_name$request_uri; ##访问http跳转到https
} ssl on;
ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; location / {
root /home/webroot/sylist;
index index.php index.html index.htm;
auth_basic "Welcom to chenjianwen webside!";
auth_basic_user_file htpasswd; ##启用用户认证
#autoindex on;
}
}
}

nginx.conf_2017-11-24的更多相关文章

  1. Unparseable date: "Mon Aug 15 11:24:39 CST 2016",时间格式转换异常

    String datestr= "Mon Aug 15 11:24:39 CST 2016";//Date的默认格式显示 Date date=new SimpleDateForma ...

  2. nginx accept() failed (24: Too many open files)

    nginx服务器出现如下信息: [crit] 17221#0: accept4() failed (24: Too many open files) [crit] 17221#0: accept4() ...

  3. PSP(11.24~11.30)

    27号 类别c 内容c 开始时间s 结束e 中断I 净时间T 作业 构建执法.写博客 14:00 14:40 0m 40m 28号 类别c 内容c 开始时间s 结束e 中断I 净时间T java 编码 ...

  4. 菜鸟学习-C语言函数参数传递详解-结构体与数组 分类: C/C++ Nginx 2015-07-14 10:24 89人阅读 评论(0) 收藏

    C语言中结构体作为函数参数,有两种方式:传值和传址. 1.传值时结构体参数会被拷贝一份,在函数体内修改结构体参数成员的值实际上是修改调用参数的一个临时拷贝的成员的值,这不会影响到调用参数.在这种情况下 ...

  5. 2018.11.24 poj3693Maximum repetition substring(后缀数组)

    传送门 后缀数组好题. 考虑枚举循环节长度lenlenlen. 然后考虑枚举循环节的起点来更新答案. 但是直接枚举每次O(n)O(n)O(n). 考虑枚举len∗k+1len*k+1len∗k+1作为 ...

  6. 2017.11.24 Stm8L151-factory

    Marking---------factory fun... /** ***************************************************************** ...

  7. 2017.11.24 算法分析与设计------Gay格雷码

    1. 格雷码问题: 对于给定的正整数n,格雷码为满足如下条件的一个编码序列: (1) 序列由2n个编码组成,每个编码都是长度为n的二进制位串. (2) 序列中无相同的编码. (3) 序列中位置相邻的两 ...

  8. 【UML】之简单概括 标签: uml图形 2014-11-09 11:24 1130人阅读 评论(24) 收藏

    29号开始看UML的视频,由于之前看视频总是一拖拖上半个月,所以这次打算速战速决,而且UML视频的讲解和内容并不算多,也比较容易懂,到后期更是花了很多时间来举例子巩固各种图的画法,所以这次花了11天初 ...

  9. Sprint(第十一天11.24)

  10. linux命令之chmod 2011.11.24转载于网络

    使用权限 : 所有使用者 使用方式 : chmod [-cfvR] [--help] [--version] mode file... 说明 : Linux/Unix 的档案调用权限分为三级 : 档案 ...

随机推荐

  1. C#正则_取出标签内的内容(非贪婪)

    using System.Text.RegularExpressions; /// <summary>        /// 执行正则提取出值        /// </summar ...

  2. mybatis之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'time' in 'class java.lang.String'

    mybatis接口 List<String> getUsedCate(String time); 配置文件 <select id="getUsedCate" pa ...

  3. day40 数据结构-算法(二)

    什么是数据结构? 简单来说,数据结构就是设计数据以何种方式组织并存储在计算机中. 比如:列表.集合与字典等都是一种数据结构. N.Wirth: “程序=数据结构+算法” 列表 列表:在其他编程语言中称 ...

  4. 基于深度学习的恶意样本行为检测(含源码) ----采用CNN深度学习算法对Cuckoo沙箱的动态行为日志进行检测和分类

    from:http://www.freebuf.com/articles/system/182566.html 0×01 前言 目前的恶意样本检测方法可以分为两大类:静态检测和动态检测.静态检测是指并 ...

  5. javascript中的回调函数

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. threejs 通过bufferGeometry处理每一个点的位置和颜色

    let positions = new Float32Array(points.length * 3); let colors = new Float32Array(points.length * 3 ...

  7. (译)KVO的内部实现

    09年的一篇文章,比较深入地阐述了KVO的内部实现.   KVO是实现Cocoa Bindings的基础,它提供了一种方法,当某个属性改变时,相应的objects会被通知到.在其他语言中,这种观察者模 ...

  8. Plus and Square Root

    ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ...

  9. 【java多线程】java的内存模型

    Java内存模型 下面是我从百度上引入的一张具有代表性的图 ①解释:我根据这张图来解释java内存模型,从图中可以看出每个线程都需要从主内存中读取操作,这个就是java内存模型的规定之一,所有的变量存 ...

  10. StringUtils的工具类isBlank与isEmply

    1. public static boolean isEmpty(String str)   判断某字符串是否为空,为空的标准是 str==null 或 str.length()==0   下面是 S ...