Copyright © 2022-2025 aizws.net · 网站版本: v1.2.6·内部版本: v1.23.4·
页面加载耗时 0.00 毫秒·物理内存 71.6MB ·虚拟内存 1300.8MB
欢迎来到 AI 中文社区(简称 AI 中文社),这里是学习交流 AI 人工智能技术的中文社区。 为了更好的体验,本站推荐使用 Chrome 浏览器。
Nginx 由由配置文件中定义的指令控制的模块组成。指令分为两部分:
置于任何上下文之外的配置文件中的指令被视为在主上下文中。 events 和 http 指令位于 main 上下文中,服务器位于 http 和 location 在服务器中。
让我们看看一些重要指令的列表:
指令 | 语法 | 默认 | 上下文 |
absolute_redirect | absolute_redirect on | off; | absolute_redirect on; | http, server, location |
accept_mutex | accept_mutex on | off; | off | Events |
accept_mutex_delay | accept_mutex_delay time; | accept_mutex_delay 500ms; | Events |
access_log(ngx_http_log_module) | access_log path [format [buffer=size] [gzip[=level]] [flush=time] [if=condition]];access_log off; | access_log logs/access.log combined; | http, server, location, if in location, limit_except |
access_log(ngx_stream_log_module) | access_log 路径格式 [buffer=size] [gzip[=level]] [flush=time] [if=condition];access_log off; | access_log off; | stream, server |
add_after_body | add_before_body uri; | - | http, server, location |
add_before_body | add_before_body uri; | - | http, server, location |
add_header | add_header name value [always]; | - | http, server, location, if in location |
add_trailer | add_trailer name value [always]; | - | http, server, location, if in location |
addition_types | addition_types mime-type ...; | addition_types text/html; | http, server, location |
aio | aio on | off | threads[=pool]; | aio off; | http, server, location |
aio_write | aio_write on | off; | aio_write off; | http, server, location |
alias | alias path; | - | Location |
allow (ngx_http_access_module) | allow address | CIDR | unix: | all; | - | http, server, location、limit_except |
allow (ngx_stream_access_module) | allow address | CIDR | unix: | all; | - | Stream, server |
ancient_browser | ancient_browser string ...; | - | http, server, location |
ancient_browser_value | ancient_browser_value string; | ancient_browser_value 1; | http, server, location |
api | api [write=on|off];</td> | - | location |
auth_basic | auth_basic string | off; | auth_basic off; | http, server, location、limit_except |
auth_basic_user_file | auth_basic_user_file 文件; | - | http, server, location、limit_except |
auth_http | auth_http 网址; | - | mail, server |
auth_http_header | auth_http_header 头值; | - | mail, server |
auth_http_pass_client_cert | auth_http_pass_client_cert 开启 | off; | auth_http_pass_client_cert 关闭; | mail, server |
auth_http_timeout | auth_http_timeout 时间 | auth_http_timeout 60s; | mail, server |
auth_jwt | auth_jwt string [token=$variable] | off; | auth_jwt off; | http, server, location、limit_except |
auth_jwt_claim_set | auth_jwt_claim_set $variable name ...; | - | http |
auth_jwt_header_set | auth_jwt_header_set $variable name ...; | - | http |
auth_jwt_key_file | auth_jwt_key_file 文件; | - | ttp, server, location, limit_except |
auth_jwt_key_request |
变量是编程语言的自然组成部分。这些只是在 Perl、C/C++、Bourne shell、Perl 等命令式语言中保存各种值的容器。值可以是像"hello world"这样的字符串,像"3.14"这样的数字,甚至是复杂的东 ...