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. 网络编程 单机最大tcp连接数

    在tcp应用中,server事先在某个固定端口监听,client主动发起连接,经过三路握手后建立tcp连接.那么对单机,其最大并发tcp连接数是多少? 如何标识一个TCP连接 在确定最大连接数之前,先 ...

  2. FastJson中文乱码

    初学springboot使用fastJson替换默认的jackson后出现中文乱码 解决方式1: import java.util.ArrayList; import java.util.List; ...

  3. StringUtils 正则校验

    public class StringUtils { /** * 如果str为null,返回“”,否则返回str * @param str * @return */ public static Str ...

  4. HQL查询语句中的模糊查询

    From Person this Where this.name like '%abc%' @SuppressWarnings("unchecked") @Override pub ...

  5. Android学习必备--java工具15个

    Weka .Weka集成了数据挖掘工作的机器学习算法.这些算法可以直接应用于一个数据集上或者你可以自己编写代码来调用.Weka包括一系列的工具,如数据预处理.分类.回归.聚类.关联规则以及可视化. M ...

  6. POJ 3087 Shuffle'm Up bfs

    题目链接:Shuffle'm Up 除了英文题有点恶心.发现模拟 + bfs 就可以过的时候,就是水了. 一个bug 就是filp函数得到string s12失败了.恩.据大腿告知,string 并不 ...

  7. vim按下ctrl+s僵死

    CTRL+S表示停止向终端停止输出 CTRL+Q恢复向终端输出流

  8. 两个Fragment之间传递数据

    1.第一个Fragment BlankFragment blankFragment = new BlankFragment();Bundle bundle = new Bundle();bundle. ...

  9. Xilinx SDK使用教程

    本文参考 Xilinx SDK软件内置的教程,打开方法:打开SDK->Help->Cheet Sheets...->Xilinx SDK Tutorials,这里有6篇文档.本文详细 ...

  10. C# 解决datatable写入文件内存溢出问题

    1.程序生成目标平台设为x64 2.文件写入后主动回收内存