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. 【Python】远离 Python 最差实践,避免挖坑

    原文链接:http://blog.guoyb.com/2016/12/03/bad-py-style/ 最近在看一些陈年老系统,其中有一些不好的代码习惯遗留下来的坑:加上最近自己也写了一段烂代码导致服 ...

  2. linux 前端部署

    linux.conf user root; worker_processes ; #error_log logs/error.log; #error_log logs/error.log notice ...

  3. 为什么需要消息队列MQ?

    主要原因:是在高并发情况下,由于来不及同步处理,请求往往会发生堵塞,比如诸多的insert.update之类的请求同时到达mysql,直接导致无数的行锁表锁,甚至最后请求会堆积很多,从而触发大量的to ...

  4. data模块

    这个模块原本应该存放Excel文件,提供utils目录下的config模块调用: 这里公司内部无法使用Excel读取数据,顾使用了ddt,其实里面就是.xslx文件

  5. JDK环境变化配置

    JDK环境变化配置 第一"JAVA_HOME" JAVA_HOME的内容是jdk安装目录.如小编安装的位置:D: \Java\jdk1.7.0_60,并且后边不带分号 第二, CL ...

  6. PHP:第五章——字符串与数组及其他函数

    <?php header("Content-Type:text/html;charset=utf-8"); //1.str_split——将字符串转换为数组. /*$str= ...

  7. 有效二叉查找树判断(java实现)

    leetcode 原题 :(即判断二叉树是否为二叉查找树) Given a binary tree, determine if it is a valid binary search tree (BS ...

  8. 如何优化tomcat配置优化

    tomcat默认参数是为开发环境制定,而非适合生产环境,尤其是内存和线程的配置,默认都很低,容易成为性能瓶颈. tomcat内存优化 linux修改TOMCAT_HOME/bin/catalina.s ...

  9. 把mac地址转换为标准mac地址

    把"00:90:8A:1D:30:51"转换成"00-90-8A-1D-30-51",如何格式错误,显示出格式错误的种类,有些不规范的转换成规范的格式,例如,& ...

  10. 《FDTD electromagnetic field using MATLAB 》读书笔记001-差商种类

    有限差分就是用差商代替微商,有3钟: 1.向前差商 2.向后差商 3.中心差商 上面三张途中虚线就是函数在x的精确微商(偏导数),直线就是用来代替精确 微商的差商格式.