艾滋病知识普及及:HTML 5到底是个什么东西

Nginx服务器配置文件完全解析
投稿:goldensun
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了Nginx服务器配置文件完全解析,Nginx的异步非阻塞特性使其拥有非常出色的性能,需要的朋友可以参考下
// 使用的用户和组
worker_processes 8; // 指定的工作衍生进程数(一般等于cpu总核数或总核数的2倍)
error_log logs/nginx_error. // 指定错误日志存放的路径,错误日志记录级别分别选项为:debug,info,notice,warn,error,crit
#error_log logs/error.
#error_log logs/error.
#error_log logs/error.
nginx. // 指定pid文件存放的路径
logs/nginx.
worker_rlimit_nofile 65535; // 一个nginx进程打开的最多文件描述符数目,理论值是最多打开的文件数(系统ulimit -n)与nginx进程数相除,但是nginx分配请求并不均匀,所以在这里建议和ulimit 值保持一致
// 使用网络I/O模型,Linux系统推荐采用epoll模型,FreeBSD系统推荐采用kqueue模型
worker_connections 51200; // 允许的连接数
# 设定http服务器,利用它的反向代理功能提供负载均衡支持
mime. // 设定mime类型,类型由mime.type文件定义
default_type application/octet-
charset utf-8; // 设置使用的字符集,如果一个网站有多种字符集,请不要随便设置,应该让程序员在HTML代码中通过Meta标签设置
// 页面静态化的一个大问题是登陆用户访问如果静态化,大部分页面内容需要缓存但是用户登陆的个人信息是动态的,ssi用来解决页面部分缓存问题
ssi_silent_ // 默认是off,开启后在处理SSI文件出错时不输出错误提示:"[an error occurred while processing the directive]"
ssi_types text/ // 默认是ssi_types text/html,所以如果需要htm和html支持,则不需要设置这句,如果需要shtml支持,则需要设置
#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.
# 开启高效文件传输模式,sendfile指令指定nginx是否调用sendfile函数来输出文件,对于普通应用设为on,如果用来进行下载等应用磁盘IO重负载应用,可设置为off,以平衡磁盘与网络I/O处理速度,降低系统的负载,如果图片显示不正常把这个改成off
#tcp_ // 防止网络阻塞
# // 开启目录列表访问,合适下载服务器,默认关闭
server_names_hash_bucket_size 128; // 服务器名字的hash表大小
client_header_buffer_size 32k; // 上传文件大小限制
large_client_header_buffers 4 32k; // 设定请求缓存
client_max_body_size 300m; // 设定请求缓存
# (与php-fpm有关) 优化的上传支持,可以加速对大POST 请求的处理速度,包括文件上传。优化是通过将请求体已写入一个临时文件,然后fastcgi 协议传递文件名而不是请求体到来实现的
client_body_in_file_
client_body_temp_path /dev/shm 1 2;
# 这个参数设置比较大时,使用firefox或ie提交一个小于512K的图片访问都会正常,注释改指令模式大小是操作系统页面大小的两倍,8K或16K ,一般提交的图片大于512K,提交的内容会写入到临时的文件,不会出现任何问题。当取消了目录访问权限(),如果提交的图片大于512K 都会返回500 Internal Server Error错误
client_body_buffer_size 512k;
proxy_connect_timeout
5; // 后端服务器连接的超时时间_发起握手等候响应超时时间(代理连接超时)
proxy_read_timeout
60; // 连接成功后_等候后端服务器响应时间_其实已经进入后端的排队之中等候处理(后端服务器处理请求的时间)
proxy_send_timeout
5; // 后端服务器数据回传时间_就是在规定时间之内后端服务器必须传完所有的数据
proxy_buffer_size
16k; // 该指令设置缓冲区大小,从代理后端服务器取得的第一部分的响应内容,会放到这里,小的响应header通常位于这部分响应内容里边.(保存用户头信息的缓冲区大小)
proxy_buffers
4 64k; // 该指令设置缓冲区的大小和数量,从被代理的后端服务器取得的响应内容,会放置到这里. 默认情况下,一个缓冲区的大小等于内存页面大小,可能是4K也可能是8K,这取决于平台
proxy_busy_buffers_size 128k; // 有处在busy状态的buffer size加起来不能超过proxy_busy_buffers_size,控制同时传输到客户端的buffer数量的
proxy_temp_file_write_size 128k; // # 临时文件写入大小
# nginx和cgi之间的超时时间
fastcgi_connect_timeout 90;
fastcgi_send_timeout 90;
fastcgi_read_timeout 90;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
# 开启gzip压缩
gzip_min_length 1k;
gzip_buffers
# 对http/1.1协议的请求才会进行压缩,如果使用了反向代理,那么nginx和后端的upstream server服务器是使用的1.0协议通信
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types
text/plain application/x-javascript text/css application/
# nginx缓存目录(在location段落下需要配合proxy_store on 开启缓存机制 include proxy.conf 处理的详细规则
if (!-e $request_filename)){proxy_pass http://192.168.10.10;}
proxy_temp_path
/data/wwwroot/proxy_temp_
#proxy_cache_path /data/wwwroot/ levels=1:2
keys_zone=:3000m inactive=1y max_size=80G;
# Nginx 内部重定向规则会被启动,当URL 指向一个目录并且在最后没有包含“/”时,Nginx 内部会自动的做一个301 重定向,这时会有两种情况
# 1、server_name_in_redirect on(默认),URL 重定向为:server_name 中的第一个域名+ 目录名+ /;
# 2、server_name_in_redirect off,URL 重定向为:原URL 中的域名+ 目录名+ /
server_name_in_
# sub filter
# include sub_filter.
# null hostname
return 444;
listen 5566;
index index.html index.htm index.shtml index.
location ~ ^/status/
#---------------- Vhost --------------------#
include vhost/*.
# 以下时阿里云主机上的一段nginx.conf配置文件
error_log /alidata/log/nginx/error.
/alidata/server/nginx/logs/nginx.
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;
worker_connections 65535;
default_type application/octet-
#charset gb2312;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
keepalive_timeout 15;
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_min_length 1k;
gzip_buffers
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types
text/plain application/x-javascript text/css application/
gzip_disable msie6;
#limit_zone crawler $binary_remote_addr 10m;
log_format '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
include /alidata/server/nginx/conf/vhosts/*.
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具你的位置: >
> 修改Nginx web服务器默认目录
安装配置好nginx服务器后默认目录是/usr/share/nginx/html
默认的目录和我自定义的目录不匹配,因此就需要修改掉ngin目录的位置;
修改它默认的配置文件就OK,位置为/etc/nginx/conf.d/default.conf
amh控制面板路径为:/usr/share/alsa/pcm/default.conf
#charset koi8-r;
#access_log
/var/log/nginx/log/host.access.
location / {
/usr/share/nginx/
index.html index.
#error_page
12345678910111213
server {&&&&listen&&&&&& 80;&&&&server_name&&localhost;&&&&&#charset koi8-r;&&&&#access_log&&/var/log/nginx/log/host.access.log&&&&&&&location / {&&&&&&&&root&& /usr/share/nginx/html;&&&&&&&&index&&index.html index.htm;&&&&}&&&&&#error_page&&404&&&&&&&&&&&&&&/404.
第九行root 后面就是被定义的目录地址,根据需求自由修改
修改nginx目录报错403解决办法
刚好我就遇到了,一查发现是权限不足引起;
chmod -R 755 /usr/share/nginx/html
chmod -R 755 /usr/share/nginx/html
将web目录设置为755权限,-R表示向下递归
chown -R nginx_user:nginx_user
/usr/share/nginx/html
chown -R nginx_user:nginx_user&& /usr/share/nginx/html
赋予nginx用户为该目录的用户所有者
nginx服务器重启命令:
/etc/init.d/nginx restart
/etc/init.d/nginx restart
转载请注明: &
与本文相关的文章温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
我想我就是那海上的一只帆,期盼着穿越大海,在月光照耀的丛林中穿梭.在那天地之灵处找到我的港湾。
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(20050)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_087068',
blogTitle:'nginx做为静态html网页服务器配置',
blogAbstract:'nginx/conf/nginx.conf 文件内容如下:
-----------------------------------------
error_log& /usr/local/webserver/nginx/logs/nginx_error.log&pid&&&&&&& /usr/local/webserver/nginx/nginx.
#Specifies the value for maximum file descriptors that can be opened by this process.worker_rlimit_nofile 65535;
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:8,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'我想我就是那海上的一只帆,期盼着穿越大海,在月光照耀的丛林中穿梭.在那天地之灵处找到我的港湾。
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

我要回帖

更多关于 小学生肺结核知识普及 的文章

 

随机推荐