user  www www;



worker_processes auto;



error_log 
/home/wwwlogs/nginx_error.log  crit;



pid       
/usr/local/nginx/logs/nginx.pid;



#Specifies the value for maximum file descriptors that can be
opened by this process.

worker_rlimit_nofile 51200;



events

    {

       
use epoll;

       
worker_connections 51200;

       
multi_accept on;

    }



http

    {

       
include      
mime.types;

       
default_type  application/octet-stream;



       
server_names_hash_bucket_size 128;

       
client_header_buffer_size 32k;

       
large_client_header_buffers 4 32k;

       
client_max_body_size 50m;



       
sendfile   on;

       
tcp_nopush on;



       
keepalive_timeout 60;



       
tcp_nodelay on;



       
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 256k;



       
gzip on;

       
gzip_min_length  1k;

       
gzip_buffers    
4 16k;

       
gzip_http_version 1.1;

       
gzip_comp_level 2;

       
gzip_types    
text/plain application/javascript application/x-javascript
text/javascript text/css application/xml application/xml+rss;

       
gzip_vary on;

       
gzip_proxied   expired no-cache
no-store private auth;

       
gzip_disable   "MSIE
[1-6]\.";



       
#limit_conn_zone $binary_remote_addr zone=perip:10m;

       
##If enable limit_conn_zone,add "limit_conn perip 10;" to server
section.



       
server_tokens off;

       
access_log off;



server

    {

       
listen 80 default_server;

       
#listen [::]:80 default_server ipv6only=on;

       
server_name _;

       
index index.html index.htm index.php;

       
root  /home/wwwroot/default;



       
#error_page  
404   /404.html;



       
# Deny access to PHP files in specific directory

       
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ {
deny all; }



       
include enable-php.conf;



       
location /nginx_status

       
{

           
stub_status on;

           
access_log   off;

       
}



       
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

       
{

           
expires     
30d;

       
}



       
location ~ .*\.(js|css)?$

       
{

           
expires     
12h;

       
}



       
location ~ /.well-known {

           
allow all;

       
}



       
location ~ /\.

       
{

           
deny all;

       
}

    

    if (!-e
$request_filename) {

           
rewrite  ^(.*)$ 
/index.php?s=/$1  last;

           
break;

       
}



       
access_log  /home/wwwlogs/access.log;

    }

include vhost/*.conf;

}

nginx.conf文件的更多相关文章

  1. 借用nginx.vim工具进行语法高亮和格式化配置nginx.conf文件

    在生产环境中,我们肯定经常用到nginx.conf文件的编排工作,今天在阅读<决战nginx>的时候无意间看到nginx.vim这个辅助工具,于是百度搜索和实际部署检测了一下,其效果确实让 ...

  2. 虚拟主机ip配置,nginx.conf文件配置及日志文件切割

    今天粗略整理了一下虚拟主机配置,nginx.conf文件的配置,及日志文件的切割,记录如下: nginx虚拟主机配置:1.IP地址配置,2.绑定ip地址和虚拟主机详情:1.ip地址的配置:ifconf ...

  3. Dockerfile + Nginx.conf文件记录(用于前端项目部署)

    Dockerfile + Nginx.conf文件记录(用于前端项目部署) 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统(敏感信息都进行了处理),默认服 ...

  4. 在k8s中将nginx.conf文件内容创建为ConfigMap挂载到pod容器中

    将nginx.conf文件内容创建为ConfigMap user nginx; worker_processes auto; error_log /var/log/nginx/error.log er ...

  5. docker+nginx搭建tomcat集群(附录)——nginx.conf文件

    附录:nginx.conf修改后的文件内容 user root;worker_processes 2; #error_log logs/error.log;#error_log logs/error. ...

  6. nginx conf 文件

    server { listen ; server_name local.light.com; index index.html index.htm index.php; root /home/wwwr ...

  7. 详解nginx.conf文件配置项(包括负载均衡)

    http://www.cnblogs.com/hsapphire/archive/2010/04/08/1707109.html #运行用户 user  nobody nobody; #启动进程 wo ...

  8. nginx.conf文件说明

    #Nginx所有用户和组,window下不指定 #user nobody; #工作的子进程数量(通常等于CPU数量或者2倍于CPU) worker_processes 1; #错误日志存放路径 #er ...

  9. nginx.conf文件配置明细详解

    #etnx运行的用户和用户组 user nginx nginx; #工作进程数,建议设置为CPU的总核数 worker_processes ; #全局错误日志定义类型,日志等级从低到高依次为: #de ...

随机推荐

  1. 每天学一点Docker(5)——了解Docker架构

    Docker的核心组件: 1.Docker客户端 - Client 2.Docker服务器 - Docker deamon 3.Docker镜像 - Image 4.仓库 - Registry 5.D ...

  2. python中的if __name__=='__main__': main()解析

    python中我们会看到一段代码是这样的: if __name__=='__main__': main() 这段代码的什么意思,我们可以知道代码的意思是如果__name__=='__main__'为T ...

  3. 为什么很多第三方接口,都改成了基于http,直接传递json数据的方式来代替webservice?

    这实际上是三个问题,从WebService到今天流行的RESTful API(JSON) over HTTP,经历了数次变革 1 WebService有很多协议,为什么HTTP比较流行? WebSer ...

  4. JS中闭包、函数与对象的介绍和用法

    闭包 闭包概念:当一个内部函数被调用,就会形成闭包,闭包就是能够读取其他函数内部变量的函数,定义在一个函数内部的函,创建一个闭包环境,让返回的这个子程序抓住i,以便在后续执行时可以保持对这个i的引用. ...

  5. css动画-音频跳动

    css动画-音频跳动 ---------------------------------------------------------------------------- ------------ ...

  6. MySQL创建表的语句

    show variables like 'character_set_client';#查询字符集 show databases;#列出所有的服务器上的数据库alter create database ...

  7. 【转】adb shell dumpsys 命令

    adb shell dumpsys,默认打印出当前系统所有service信息,在后面可加上具体的服务名 需要列出当前运行的服务,可运行: adb shell dumpsys | findstr DUM ...

  8. CSS(四)float 定位

    一.文档流 网页默认的定位方式 1.行级元素: 从左到右 2.块级元素: 从上到下 文档流的流动方式  从右下 到 左上 ↖ 二.浮动 1.浮动的定义 , 是元素脱离文档流  遇到父级边界 或相邻浮动 ...

  9. (4程序框架)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练

    从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练 1综述http://www.cnblogs.com/jsxyhelu/p/7907241.html2环境架设http://www.cn ...

  10. 关于获得当前的index的方法

    每日一句English(start from today): In the previous section we just displayed a list of string entered st ...