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的数量相等 ...
随机推荐
- cogs p服务点设置
5. P服务点设置 ★★ 输入文件:djsc.in 输出文件:djsc.out 简单对比时间限制:2 s 内存限制:128 MB 问题描述为了进一步普及九年义务教育,政府要在某乡镇建立 ...
- 14、Django实战第14天:列表筛选功能
今天完成的是点击这些条件进行机构的筛选 首先来完成城市:当用户点击城市的时候,我们自动给它加一个参数(city.id) 编辑organization.views.py 刷新页面,发现筛选功能已经OK了 ...
- SQL Loader with utf8
alter this line in your control file characterset UTF8 to this characterset UTF8 length semantics ch ...
- luogu P1095 守望者的逃离
题目描述 恶魔猎手尤迪安野心勃勃,他背叛了暗夜精灵,率领深藏在海底的娜迦族企图叛变.守望者在与尤迪安的交锋中遭遇了围杀,被困在一个荒芜的大岛上.为了杀死守望者,尤迪安开始对这个荒岛施咒,这座岛很快就会 ...
- 【可持久化Trie】【set】bzoj3166 [Heoi2013]Alo
枚举每个数,计算以其为次大数的最大区间,显然,只需要用这个区间的答案 对 答案进行更新即可. 找到每个数右侧.左侧第1.2个比它大的数,然后分类讨论一下即可. 找到的过程中把数sort以后,从大到小把 ...
- 3.4常用类(java学习笔记)Math和Random
一.Math 这个类包含执行指数.对数.平方根法.三角函数等基本的数字运算. Math中还包含一些静态常量供我们调用. 如PI圆周率,E. 1.abs(),返回该数的绝对值. public class ...
- Problem Y: 零起点学算法21——摄氏温度转换
#include<stdio.h> int main() { float f,c; while(scanf("%f",&f)!=EOF) c=*(f-); pr ...
- Git学习笔记(一) 安装及版本库介绍
安装Git 最早Git是在Linux上开发的,很长一段时间内,Git也只能在Linux和Unix系统上跑.不过,慢慢地有人把它移植到了Windows上.现在,Git可以在Linux.Unix.Mac和 ...
- Delphi制作软键盘
{ 作者: han 日期: 2006.06.02 } unit softkey; interface uses Windows, Messages, SysUtils, Variants, C ...
- Vmware+Virtualbox+Ubuntu+debian+USB转串口+kermit
当前的环境是:在Win7笔记本主机上安装VirtualBox+Ubuntu12_04,串口使用USB转串口 如果使用的虚拟机是VirtualBox: 如果使用的虚拟机是Vmware: 执行这步后,主机 ...