wulinghui commented on issue #7924: URL: https://github.com/apache/apisix/issues/7924#issuecomment-1250759171
## 版本: apache/apisix:2.14.1-alpine ## 配置文件 apisix-docker/example/apisix_conf/config.yaml ``` # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # apisix: node_listen: 9080 # APISIX listening port enable_ipv6: false show_upstream_status_in_response_header: true allow_admin: # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow #- 0.0.0.0/0 # We need to restrict ip access rules for security. 0.0.0.0/0 is for test. - 172.0.0.0/8 admin_key: - name: "admin" #key: edd1c9f034335f136f87ad84b625c8f1 key: 8c1c43c1f0ae5ed11a1939df0a5119be role: admin # admin: manage all configuration data # viewer: only can view configuration data - name: "viewer" key: 4054f7cf07e344346cd3f287985e76a2 role: viewer enable_control: true control: ip: "0.0.0.0" port: 9092 etcd: host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster. - "http://etcd:2379" # multiple etcd address prefix: "/apisix" # apisix configurations prefix timeout: 30 # 30 seconds plugin_attr: prometheus: export_addr: ip: "0.0.0.0" port: 9091 #http nginx_config: http: enable_access_log: true access_log: logs/access.log access_log_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 \"$upstream_scheme://$upstream_host$upstream_uri\"" access_log_format_escape: default #keepalive_timeout: 600s keepalive_timeout: 0 #client_header_timeout: 600s #client_body_timeout: 600s #client_max_body_size: 0 #send_timeout: 600s upstream: # keepalive: 10000 #keepalive_requests: 10000 #keepalive_timeout: 600s keepalive_timeout: 0 #nacos discovery: nacos: host: - "http://nacos:Nacos@[email protected]:8849" prefix: "/nacos/v1/" fetch_interval: 30 # default 30 sec weight: 100 # default 100 timeout: connect: 2000 # default 2000 ms send: 2000 # default 2000 ms read: 5000 # default 5000 ms ``` ## 路由: ``` { "uri": "/ysms-brainOps-web/**", "name": "ysms-brainOps-web", "methods": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "CONNECT", "TRACE" ], "plugins": { "jwt-auth": { "disable": false } }, "upstream_id": "416653577696576196", "status": 1 } ``` ## 消费者: ```json { "username": "jwt_foo", "plugins": { "jwt-auth": { "algorithm": "HS256", "base64_secret": false, "exp": 86400, "key": "foo", "secret": "my-secret-key" } } } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
