语法 默认 描述
absolute_redirect on ? off; on http, server, location 绝对路径
aio on ? off threads[=pool]; off http, server, location
aio_write on ? off; http, server, location
alias path; location
chunked_transfer_encoding on ? off; on http, server, location 块传输
client_body_buffer_size size; 8k?16k http, server, location 请求的buffer
client_body_in_file_only on ? clean ? off; off http, server, location 是否将请求保存到文件,debug使用
client_body_in_single_buffer on ? off; off http, server, location 是否将请求保存在buffer中
client_body_temp_path path [level1 [level2 [level3]]]; client_body_temp http, server, location 临时存放请求的文件
client_body_timeout time; 60s http, server, location 读取请求体的超时时间
client_header_buffer_size size; 1k http, server 请求头的buffer
client_header_timeout time; 60s http, server 请求头的超时时间
client_max_body_size size; 1m http, server, location 请求体大小的上限
connection_pool_size size; 256?512 http, server 每个连接的内存空间大小
default_type mime-type; text/plain http, server, location 相应的MIME类型
directio size ? off; off http, server, location ?
directio_alignment size; 512 http, server, location ?
disable_symlinks off; off http, server, location ?
error_page code … [=[response]] uri; http, server, location, if in location 错误页面显示
etag on ? off; on http, server, location ?
http { … } main
if_modified_since off ? exact ? before; exact http, server, location Specifies how to compare modification
ignore_invalid_headers on ? off; on http, server ?
internal; location ??
keepalive_disable none ? browser …; msie6 http, server, location?
keepalive_requests number; 100 http, server, location ?
keepalive_timeout timeout [header_timeout]; 75s http, server, location
large_client_header_buffers number size; 4 8k http, server
limit_except method … { … } location
limit_rate rate; 0 http, server, location, if in location
limit_rate_after size; 0 http, server, location, if in location
lingering_close off ? on ? always; on http, server, location
lingering_time time; 30s http, server, location
lingering_timeout time; 5s http, server, location
listen address[:port] *:80 server 监听端口
location [ = ~ ~* ^~ ] uri { ... } server, location
log_not_found on ? off; on http, server, location
log_subrequest on ? off; off http, server, location
max_ranges number; http, server, location
merge_slashes on ? off; on http, server
msie_padding on ? off; on http, server, location
msie_refresh on ? off; off http, server, location
open_file_cache off; off http, server, location
open_file_cache_errors on ? off; off http, server, location
open_file_cache_min_uses number; 1 http, server, location
open_file_cache_valid time; 60s http, server, location
output_buffers number size; 2 32k http, server, location
port_in_redirect on ? off; on http, server, location
postpone_output size; 1460 http, server, location
read_ahead size; 0 http, server, location
recursive_error_pages on ? off; off http, server, location
request_pool_size size; 4k http, server
reset_timedout_connection on ? off; off http, server, location
resolver address … [valid=time] [ipv6=on off] [status_zone=zone]; http, server, location
resolver_timeout time; 30s http, server, location
root path; html http, server, location, if in location
satisfy all ? any; all http, server, location
send_lowat size; 0 http, server, location
send_timeout time; 60s http, server, location
sendfile on ? off; off http, server, location, if in location
sendfile_max_chunk size; 0 http, server, location
server { … } - http
server_name name …; “” server 虚拟服务
server_name_in_redirect on ? off; off http, server, location
server_names_hash_bucket_size size; 32?64?128 http
server_names_hash_max_size size; 512 http
server_tokens on ? off ? build ? string; on http, server, location
subrequest_output_buffer_size size; 4k?8k http, server, location
tcp_nodelay on ? off; on http, server, location
tcp_nopush on ? off; off http, server, location
try_files file … uri; server, location
types { … }
types_hash_bucket_size size;
types_hash_max_size size;
underscores_in_headers on ? off;
variables_hash_bucket_size size;
variables_hash_max_size size;

alias root

location /i/ {alias /data/w3/images/;
}

on request of “/i/top.gif”, the file /data/w3/images/top.gif will be sent.

location /i/ {root /data/w3;
}

The /data/w3/i/top.gif file will be sent in response to the “/i/top.gif” request.

error

error_page 404             /404.html;
error_page 500 502 503 504 /50x.html;

limit_except

limit_except GET {allow 192.168.1.0/32;deny  all;
}

listen

listen 127.0.0.1:8000;
listen 127.0.0.1;
listen 8000;
listen *:8000;
listen localhost:8000;

If only address is given, the port 80 is used.
The ssl parameter specifying that all connections accepted on this port should work in SSL mode

location

server_name

反向代理的目标,可以是域名,可以是ip

https://www.jianshu.com/p/181872fd4de3

参考:
http://nginx.org/en/docs/http/ngx_http_core_module.html

nginx ngx_http_core_module(http server location)相关推荐

  1. location php,Nginx服务器中的location配置详解

    语法location  [=|~|~*|^~] /uri/  {...} 规则= : 表示精确的URI匹配(有兴趣的同学可以看一下url和uri的区别) -: 表示区分大小写的正则匹配 -*:表示不区 ...

  2. php+loaction+框架,【集锦】nginx【php,location,alias,504】

    [汇总]nginx[php,location,alias,504] ?? 安装#tar -zxvf nginx-1.0.5.tar.gz#cd nginx-1.0.5#./configure --pr ...

  3. Nginx之正则表达式、location匹配简介以及rewrite重写

    目录 一.Nginx 正则表达式 二.location 匹配简介 1.匹配规则格式 ①.精准匹配 ②.一般匹配 ③.正则匹配 2.常用的匹配规则 3.匹配的优先级 4.示例 5.实际网站使用中,至少有 ...

  4. 炎炎夏日,深夜详谈nginx的配置中location和rewrite的语法规则(从入门到高手的第六步)

    前言 在生产实际中,当用户页面请求后,很多是需要自动跳转到其他特定页面,这个时候往往可以利用nginx配置中location规则或rewrite语法进行设置. Nginx提供的全局变量或自己设置的变量 ...

  5. Nginx配置请求转发location及rewrite规则

    location = / {# 精确匹配 / ,主机名后面不能带任何字符串[ configuration A ] }location / {# 因为所有的地址都以 / 开头,所以这条规则将匹配到所有请 ...

  6. 多个前端项目部署在nginx中同一个server下

    多个前端项目部署在同一个域名下 在vue.config.js中设置 publicPath: '/web/' 在路由index.js中设置 base:'/web/' 在index.html中加入 修改N ...

  7. nginx多个server的配置,同一端口

    nginx多个server的配置,同一端口 nginx多个server的配置,同一端口 #user nobody; worker_processes 1;#error_log logs/error.l ...

  8. nginx 反向代理以及 location /admin/

    nginx 反向代理以及 location /admin/ 反向代理时, 需要特别注意,本地测试时确保类似IP调用 127.0.0.1:8082/admin 这种情况可以直接访问,在做反向代理.否则请 ...

  9. eclipse更改Server Location的问题

    为项目配置server之后,每个项目的服务器默认是在工作空间里面的server.core/temp0(temp1或temp2)里面,如果需要修改单个的server.xml直接在eclipse的serv ...

最新文章

  1. C#时间(DateTime)格式化
  2. 021_Jedis的ZSet数据类型
  3. 4.3 matlab常用的特殊图形(条形图、直方图、饼图、散点图等)
  4. 隐藏SyntaxHighlighter滚动条
  5. 农村房屋能抵押做贷款吗?
  6. Linux中创建用户并且配置sudo权限,百分百简单有效
  7. 使用设备mac好还是随机mac好_省4000我给MBP16搭配了一块2T SSD:希捷 酷鱼飞翼 Fast SSD使用测评...
  8. java static方法
  9. 查看电脑wifi密码
  10. java try catch 接口_如何优雅的实现 try/catch 异常块?
  11. 人脸对齐(十八)--Joint Face Alignment and 3D Face Reconstruction
  12. python快速排序算法没看懂_python中的快速排序算法的理解
  13. 使用 ngrok(小米球)实现内网穿透映像到外网访问项目
  14. matlab 报童 泊松分布函数,数学建模和工科数学分析(2)
  15. Apple 850 订单EDI X12报文格式解析
  16. ORACLE11g安装包及安装过程
  17. 关于Network ACLs的理解
  18. 系统扫描修复cmd命令
  19. 关于计算机天赋测试,这是一道你绝没测过的测试题,能测出你的天赋究竟是什么...
  20. leetcode算法(2)

热门文章

  1. 查找子串在母串中的位置、编写一个函数实现字符串拼接【数据结构实验报告算法详解】
  2. 十大经典排序算法4(Python版本)
  3. Java之for和while的内容
  4. 希尔排序不稳定例子_Python实现希尔排序(已编程实现)
  5. 隐藏画质代码_和平精英120帧率代码是什么?隐藏的120帧率代码更改方法技巧
  6. Python实现多进程/多线程同时下载单个文件
  7. 使用Python处理声音文件(二):音量降低1/2
  8. Python扩展库numpy中的布尔运算
  9. HTML中name与id的区别
  10. python操作sqlite数据库_Python操作Sqlite正确实现方法解析