title: nginx speaker: 胡建霞 url: https://github.com/ksky521/nodePPT transition: cards files: /js/demo.js,/css/demo.css
[slide]
[slide]
worker_processes 1;#全局生效
events {
worker_connections 1024;#在events中生效
}
http { #以下指令只能在http中生效
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server { #server块
listen 80;
server_name localhost;
location /{ #location块
root html;
index index.html index.htm;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
讲解一下root
[slide]
[slide]
location / {
deny 192.168.1.103;#禁止ip
allow 192.168.1.1;#允许ip
deny all;
}
error_log file | stderr [debug | info | notice | warn | error | crit | alert | emerg];
error_log /var/log/nginx/error.log;
log_format custom '$remote_addr - $remote_user [$time_local] '
'"$request" $status $request_time $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_body"';
access_log /var/log/nginx/access.log custom;
##更改location 的 URI
location ~ ^/data/(.+\.(html|htm))$ {
alias /locationtest1/other/;
}
[slide]
gzip on;#开启gzip功能
gzip_min_length 5k;#响应页数据上限
gzip_buffers 4 16k;#缓存空间大小
gzip_http_version 1.0;#检查http协议版本在这之上才开启gzip
gzip_comp_level 4;#压缩等级 1-9
gzip_types text/plain application/x-javascript text/css application/xml application/json text/javascript application/x-httpd-php image/jpeg image/gif image/png;#压缩文件类型
gzip_vary on;#启用压缩标志 会带上accept-encoding gzip
gunzip_static on| off;默认关闭 是检测客户端浏览器是否支持gzip处理 检查预压缩文件
gzip_disable "MSIE [1-6]\.(?!.*SV1)";#检测是 msie4 5就不开启gzip
[slide]
[note] ##这里是note
使用n键,才能显示 [/note]
按下键盘【N】键测试下note,
markdown语法如下:
这里是 note的外表标题
[slide]
<iframe data-src="http://www.cnblogs.com/zerohu/p/6202562.html" src="about:blank;"></iframe>
[slide]