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的数量相等 ...
随机推荐
- 线段树+差分【p1438】无聊的数列
Description 维护一个数列{a[i]},支持两种操作: 1.1 L R K D:给出一个长度等于R-L+1的等差数列,首项为K,公差为D,并将它对应加到a[L]~a[R]的每一个数上.即:令 ...
- 33、Django实战第33天:我的消息
1.编辑usercenter-message.html继承usercenter-base.html 2.编辑users.views.py ... from operation.models impor ...
- leetcode191 Number of 1 Bit
题意:一个int类型正整数,求它的二进制形式有多少个1 思路:除2递归,可以解出,看了discuss里面有个解更牛,一行结束战斗,是用n&(n-1)再递归,其实并不是很懂怎么想出来这么做的,可 ...
- Hibernate 配置文件precision与scale
Oracle使用标准.可变长度的内部格式来存储数字.这个内部格式精度可以高达38位. NUMBER数据类型可以有两个限定符,如: column NUMBER ( precision, scale) 表 ...
- cogs 2554. [福利]可持久化线段树
题目链接 cogs 2554. [福利]可持久化线段树 题解 没有 代码 #include<cstdio> #include<cstring> #include<algo ...
- [BZOJ5461][LOJ#2537[PKUWC2018]Minimax(概率DP+线段树合并)
还是没有弄清楚线段树合并的时间复杂度是怎么保证的,就当是$O(m\log n)$吧. 这题有一个显然的DP,dp[i][j]表示节点i的值为j的概率,转移时维护前缀后缀和,将4项加起来就好了. 这个感 ...
- 【DFS】Gym - 101142C - CodeCoder vs TopForces
就按照题意建出有向图来(n个点,2n-2条边),然后从按随便一个rating排序,从最后一个开始dfs,用vis数组防止重复访问,因为每次之前的肯定能访问之后的(及之后的能访问的),所以不会有重复.就 ...
- 8.4(Java学习笔记)java脚本引擎(Rhino)
一.java脚本引擎 java脚本引擎是沟通java和脚本语句之间的桥梁,可以通过对应的脚本引擎在java中调用各种脚本语言. 二.脚本引擎执行脚本代码 ScriptEngineManager:为Sc ...
- 使用jQuery操作dom(追加和删除样式-鼠标移入移出)练习
1.实现鼠标移入则添加背景色,鼠标移出则删除背景色 <!DOCTYPE html> <html> <head> <title>test1.html< ...
- 在iPhone上取消APP订阅
1.在iPhone上打开APP Store,在精品推荐那个界面滚动到底部. 2.点击Apple ID那一栏,如图: 3.点击查看Apple ID,如图: 4.点击管理,如图: 5.关掉此选项,如图: ...