nginx.conf 详细
##定义nginx运行的用户各用户组
user nginx nginx;
##nginx进程数,建议设置与cpu核心数一致
worker_processes 1;
##全局错误日志定义类型[ debug | info | notice | warn | error | crit ]
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
##进程文件
#pid logs/nginx.pid;
##工作模式与连接数上限
events {
##单个进程的最大连接数
worker_connections 65535;
}
##设置http服务器
http {
##引入外置配置文件
include /etc/nginx/conf.d/*.conf;
##文件扩展名与文件类型映射表
include mime.types;
##默认文件类型
default_type application/octet-stream;
##默认编码
#charset utf-8;
##服务器名字的hash表大小
#server_name_hash_bucket_size 128;
##上传文件大小限制
#client_header_buffer_size 32K;
##设定请求缓存
#large_client_header_buffers 4 64K;
##最大缓存
client_max_body_size 8M;
##日志格式设定
#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 logs/access.log main;
##开启高效文件传输模式sendfile指令指定nginx是否调用sendfile函数来输出文件,对于普通应用设为 on,如果用来进行下载等应用磁盘IO重负载应用,可设置为off,以平衡磁盘与网络I/O处理速度,降低系统的负载。注意:如 果图片显示不正常把这个改成off。
sendfile on;
##开启目录列表访问,合适下载服务器,默认关闭
#autoindex on;
##防止网络阻塞
#tcp_nopush on;
##防止网络阻塞
#tcp_nodelay on;
##长链接超时时间,单位是秒,为0,无超时
keepalive_timeout 65;
##gzip模块设置
##开启gzip压缩输出
#gzip on;
##最小压缩文件大小
#gzip_min_length 1k;
##压缩缓冲区
#gzip_buffers 4 16k;
##压缩版本(默认1.1,前端如果squid2.5请使用1.0)
#gzip_http_version 1.0;
##压缩等级
#gzip_comp_level 2;
##压缩类型,默认就已经包含了textxml,默认不用写,写上去也没有问题,会有一个warn
#gzip_types text/plain application/x-javascript text/css application/xml;
#gzip_vary on;
##开启连接限制ip连接数使用
#limit_zone crawler $binary_remote_addr 10m;
##FastCGI相关参数是为了改善网站的性能:减少资源占用,提高访问速度。
fastcgi_connect_timeout 300;
listen 80;
##域名可以有多个,用空格隔开
server_name localhost;
#charset koi8-r;
##定义本虚拟主机的访问日志
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
##图片缓存时间设置
location ~.*.(gif|jpg|jpeg|png|bmp|swf)${
expires 10d;
}
##js和CSS缓存时间设置
location ~.*.(js|css)?${
expires 1h;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
##设定查看Nginx状态的地址
##本地动静分离反向代理配置
}
}
nginx.conf 详细的更多相关文章
- Nginx配置文件nginx.conf详细说明
Nginx配置文件nginx.conf详细说明 #worker_processes 8; #worker_cpu_affinity 00000001 00000010 00000100 0000100 ...
- Nginx配置文件nginx.conf详细说明文档
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集于网络. user www-data; #运行用户 worker_pro ...
- nginx配置文件nginx.conf超详细讲解
#nginx进程,一般设置为和cpu核数一样worker_processes 4; #错误日志存放目录 error_log /data1/logs/er ...
- Nginx 1.10.1 版本nginx.conf优化配置及详细注释
Nginx 1.10.1 的nginx.conf文件,是调优后的,可以拿来用,有一些设置无效,我备注上了,不知道是不是版本的问题,回头查一下再更正. #普通配置 #==性能配置 #运行用户 user ...
- Nginx.conf 配置文件详细说明
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data; #启动进程,通常设置成和cpu的数量相等worker_process ...
- 详细的nginx.conf中文资料整理
整理来源: https://blog.csdn.net/tjcyjd/article/details/50695922 整理结果 Nginx的配置文件nginx.conf配置详解如下: #Nginx用 ...
- Nginx nginx.conf配置文件详细说明
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data; #启动进程,通常设置成和cpu的数量相等worker_process ...
- nginx.conf配置及优化相关
nginx.conf配置文件内容 user www www; worker_processes ; worker_rlimit_nofile ; error_log /data/nginx/logs/ ...
- 【转】Nginx配置文件详细说明
Nginx配置文件详细说明 在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data; #启动进程,通常设置成和cpu的数量相等 ...
随机推荐
- Xamarin XAML语言教程控件模板的模板绑定
Xamarin XAML语言教程控件模板的模板绑定 控件模板的模板绑定 为了可以轻松更改控件模板中控件上的属性值,可以在控件模板中实现模板绑定功能.模板绑定允许控件模板中的控件将数据绑定到公共属性上. ...
- [CF160D]Edges in MST
[CF160D]Edges in MST 题目大意: 一个\(n(n\le10^5)\)个点,\(m(m\le10^5)\)条边的连通图.对于图中的每条边,判断它与该图最小生成树的关系: 在该图所有的 ...
- 动态NAT地址转换
1.配置路由器的端口ip地址(注意外网和内网ip地址的设置) Router(config)#inter f0/0 Router(config-if)#ip add 192.168.1.1 255.25 ...
- Linux下使用expect实现跳板机自动跳转/免密登录/自动登录(转)
shell脚本实现ssh自动登录远程服务器示例: #!/usr/bin/expect spawn ssh root@192.168.22.194 expect "*password:&quo ...
- [置顶] Windows显示驱动(WDDM)编程初步(2)
欢迎转载[作者:张佩][原文:http://www.yiiyee.cn/Blog/wddm2/] 第二部分专门只讲VIDPN.这是后面内容的基础.WDDM框架用VIDPN这个概念,来描述它所要处理的显 ...
- 如何垂直居中元素(浮动元素&居中一个<img>)?
1.如何居中一个浮动元素? 方法一:已知元素的高度 <!DOCTYPE html> <html lang="en"> <head> < ...
- Ado.Net基础拾遗一:读取数据
从数据库中读取数据: 使用DataReader对象从数据库中读取数据 首先需要添加几个命名空间 //需要添加的命名空间 using System.Configuration; using System ...
- 深度剖析OpenGL ES中的多线程和多窗口渲染技术
由 创新网小编 于 星期五, 2014-04-11 14:56 发表 移动设备中的CPU和GPU已经变得很强大,到处都是配备一个或多个高分辨率屏幕的设备,需要使用带有图形驱动器的复杂交互也日益增加.在 ...
- 【MySQL】海量量数据查询优化
参考资料: mysql处理海量数据时的一些优化查询速度方法:http://www.cnblogs.com/lingiu/p/3414134.html mysql千万级大数据SQL查询优化:http:/ ...
- 删除Kafka中topic
步骤: 1.编辑Kafka启动时加载的配置文件server.properties,添加一行:delete.topic.enable=true 2.重启Zookeeper和Kafka 3.执行: ./b ...