nginx:
1. flv mp4流
2. rewrite
3. referer:链接从哪里来,,可以防止盗链;
4. worker_processes = CPU个数(cpu密集型,计算) = cpu*1.5/2(IO密集型,读文件)
5. events->worker_connections 1024 ->单核最大连接数
6. location
location [ = | ~ | ~* | ^~ ] {}
6.1 路径及其子路径:
location / { root html; index index.html index.htm; }
6.2 精确匹配:
location =/ { root html; index index.html index.htm; }
6.3 模式匹配/正则匹配----大小不敏感(区分):
location ~ \.php$ { ...; }
6.4 模式匹配/正则匹配--大小写不敏感(不区分)
location ~* \.(gif|jpg|jpeg) { ...; }
6.5 逐字符匹配(非正则)
location ^~ /images/ { }
这几种的优先级顺序:
1. "=" 精确匹配 2. ^~ 非正则匹配/逐字符匹配 3. ~ 和 ~* 正则匹配 4. 尝试型匹配
A: location =/ {}
B: location / {}
C: location /documents/ {}
D: location ^~ /images/ {}
E: location ~* \.(gif|jpg|jpeg) {}
例1: / -->A
例2: /index.htm -->B
例3: /documents/document.html -->C
例4: /images/1.gif -->D
例5: /documents/1.gif -->E
7. 限定拒绝/ 允许指定的IP访问
deny / allow
默认是allow所有访问的
拒绝/bbs 路径被 192.168.1.111访问:
location /bbs { root /htdocs; index index.htm index.html; deny 192.168.1.111; }
只允许192.168.1.112主机访问,其余全部拒绝:
location /bbs { root /htdocs; index index.htm index.html; allow 192.168.1.112; deny all; }
8. autoindex
location 中设定: autoindex on
当访问server中所有的资源都匹配不了的时候,列出所有的资源列表。
9. stub_status -> 服务器状态信息统计; 包括处理的请求数、连接数等。
相关推荐
GitHub Markdown渲染 使用GitHub的和CSS在本地开发Web服务器上显示格式的文档,以模仿GitHub本身的可视显示。... Nginx或Apache URL重写支持。 用法 可从本地Web服务器访问Markdown文件,并以纯文本形式返回,例如:
8. **图片资源**:FgrM1h7yys6LP6TKNxy8F24EXY-j-marked3.png、FnpXrFkQbuCRA2UWoWJG9jOSfTyL-marked3.png、FqooiB2SvJFk0ikSNYxiLrCGUiJS-marked3.png可能是项目中的示例图片,或者是在教程中用来说明关键步骤的...
n-2", breaking the history of China without "core". The birth of "Godson" was hailed by industry insiders as a milestone in the industrialization of China's national science and technology. The ...
介绍 前后端分离项目, 文章功能支持 markdown 方式编写及展示,并且支持简书式的边写边看,支持图片一键黏贴直传七牛 ...Marked + hightlight.js + CodeMirror + react-codemirror2 Sass: css-module 后端: TypeScri
介绍 前后端分离项目, 文章功能支持 markdown 方式编写及展示,并且支持简书式的边写边看 支持移动端和响应式样式 ...Marked + hightlight.js + CodeMirror + react-codemirror2 Sass: css-module 后端: TypeScript Ko
使用nginx目录解析Marked文件 GitHub - 将项目克隆到nginx服务根目录 修改nginx配置,将md文件转发给./MARKDOWN_FOR_PHP/md.php解析。 location ~ \.md$ { rewrite .* /MARKDOWN_FOR_PHP/md.php?file=$request_...