全局配置

获取全局配置

URI

GET /admin-api/global/1/ngx

URI 参数

  • detail

    type: integer

    is_necessary: no

    description: 传任意值显示详细信息,不传显示简略信息

请求示例

Shell

curl 'https://{admin-site}/admin-api/global/1/ngx/?detail=1'

响应示例

Status: 200 OK
{
    "status":0,
    "data":{
        "proxy_buffers_size_unit":"k",
        "proxy_busy_buffers_size":100,
        "ssl_session_cache":32,
        "proxy_busy_buffers_size_unit":"k",
        "error_log_level":"error",
        "proxy_ignore_client_abort":false,
        "proxy_intercept_errors":false,
        "enable_gzip":true,
        "proxy_temp_file_write_size":160,
        "proxy_temp_file_write_size_unit":"k",
        "client_max_body_size":1,
        "client_max_body_size_unit":"m",
        "ssl_ciphers":"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256",
        "ssl_prefer_server_ciphers":true,
        "ssl_protocols":[
            "TLSv1.2"
        ],
        "ssl_session_cache_unit":"m",
        "worker_rlimit_nofile":20480,
        "ssl_session_ticket":true,
        "worker_processes":"16",
        "ssl_session_ttl":5,
        "ssl_session_ttl_unit":"min",
        "enable_ocsp_stapling":false,
        "ocsp_stapling_timeout":1,
        "ocsp_stapling_timeout_unit":"s",
        "worker_shutdown_timeout":100,
        "max_network_namespaces":24,
        "max_kept_log_files":168,
        "proxy_temp_path":"/usr/local/oredge-node/proxy_temp/",
        "send_timeout":60,
        "enable_ipv6":false,
        "proxy_cache_use_stale":[
            "off"
        ],
        "real_ip_header":"X-Real-IP",
        "real_ip_recursive":true,
        "underscores_in_headers":false,
        "custom_shared_dict_size":1,
        "custom_shared_dict_size_unit":"m",
        "enable_access_log":true,
        "avoid_gen_error_log":false,
        "proxy_connect_timeout":33,
        "client_body_timeout":60,
        "ignore_invalid_headers":true,
        "client_body_timeout_unit":"s",
        "listen_backlog":511,
        "client_header_timeout":60,
        "tcp_nopush":true,
        "client_header_timeout_unit":"s",
        "enable_open_file_cache":false,
        "gzip_buff_size_unit":"k",
        "access_log_formats":[
            {
                "default":true,
                "name":"main",
                "format":"$remote_addr - $remote_user [$time_local] $http_host
"$request" $status $body_bytes_sent $request_time
"$http_referer" "$http_user_agent" $upstream_addr
$upstream_status $upstream_response_time",
                "id":1
            },
            {
                "default":false,
                "name":"test",
                "format":"$remote_addr - $remote_user [$time_local] $http_host
"$request" $status $body_bytes_sent $request_time
"$http_referer" "$http_user_agent" $upstream_addr
$upstream_status $upstream_response_time",
                "id":2
            }
        ],
        "enable_reuseport":true,
        "client_body_temp_path":"/usr/local/oredge-node/client_body_temp/",
        "client_header_buffer_size_unit":"k",
        "log_path":"/usr/local/oredge-node/logs",
        "max_client_request_line_size":8,
        "access_log_buffer":32,
        "max_client_request_header_size":32,
        "access_log_buffer_unit":"k",
        "client_body_buffer_size":16,
        "access_log_flush":3,
        "gzip_compression_level":3,
        "worker_connections":10777,
        "enable_dns":true,
        "proxy_read_timeout":22,
        "dns_resolver_timeout":6,
        "gzip_buff_size":4,
        "gzip_types":"text/html",
        "enable_http2":false,
        "keepalive_timeout":75,
        "proxy_cache_zone":[
            {
                "inactive_unit":"day",
                "max_size":5,
                "max_size_unit":"g",
                "path":"/usr/local/oredge-node/proxy_cache",
                "id":1,
                "key_num":100,
                "key_num_unit":"m",
                "inactive":30
            }
        ],
        "open_file_cache_inactive":60,
        "gzip_http_version":"1.1",
        "open_file_cache_max":1000,
        "client_header_buffer_size":1,
        "enable_proxy_cache_revalidate":false,
        "gzip_min_length":20,
        "proxy_buffer_size":8,
        "gzip_disable_ie6":true,
        "proxy_buffer_size_unit":"k",
        "gzip_buffer_number":32,
        "proxy_buffers_count":8,
        "client_body_buffer_size_unit":"k",
        "proxy_buffers_size":16,
        "proxy_send_timeout":11,
        "custom_shared_zone":[             // 自定义的lua_shared_dict
            {
                "name":"user_test_zone_0",
                "size":1,
                "size_unit":"m"
            },
            {
                "name":"user_test_zone_1",
                "size":12,
                "size_unit":"k"
            }
        ]
    }
}

更新自定义 lua_shared_dict

URI

PUT /admin-api/global/1/ngx

请求示例

Shell

curl 'https://admin-dev.openresty.com.cn/admin-api/global/1/ngx/' \
  -X 'PUT' \
  -H 'Content-Type: application/json;charset=UTF-8' \
 --data-raw '{
    "custom_shared_zone":[
        {
            "name":"user_test_zone_0",
            "size":1,
            "size_unit":"m"
        },
        {
            "name":"user_test_zone_1",
            "size":12,
            "size_unit":"k"
        }
    ]
}'

响应示例

Status: 200 OK
{
    "status":0,
}