You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/03 09:15:21 UTC

[GitHub] [apisix-docker] leon1509 opened a new issue #94: request help: Docker部署,无法访问dashboard!版本2.1

leon1509 opened a new issue #94:
URL: https://github.com/apache/apisix-docker/issues/94


   ### Issue description
    安装方法:参考https://github.com/apache/apisix-docker/blob/master/manual.md
   
   ### Environment
   步骤:
   配置文件使用的是:https://github.com/apache/apisix-docker/example/下面的
   `
   1. docker pull bitnami/etcd
   
   2. docker pull apache/apisix
   
   3. docker network create --driver=bridge --subnet=172.18.0.0/16 --ip-range=172.18.5.0/24 --gateway=172.18.5.254 apisix
   
   4. docker run -it --name etcd-server -v /d/Work/docker-instance/apisix-docker/example/etcd_conf/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml -p 2379:2379 -p 2380:2380 --network apisix --ip 172.18.5.10 --env ALLOW_NONE_AUTHENTICATION=yes bitnami/etcd
   
   5. docker run --name apisix -v /d/Work/docker-instance/apisix-docker/example/apisix_conf/config.yaml:/usr/local/apisix/conf/config.yaml -v /d/Work/docker-instance/apisix-docker/example/apisix_log:/usr/local/apisix/logs -p 9080:9080 -p 9443:9443 --network apisix --ip 172.18.5.11 -d apache/apisix
   `
   版本号及运行命令:
   `sh-4.2# apisix version;ps -ef|grep nginx
   2.1
   root        36     1  0 08:04 ?        00:00:00 nginx: master process /usr/local/openresty/bin/openresty -p /usr/local/apisix -g daemon off;
   nobody      37    36  0 08:04 ?        00:00:04 nginx: worker process
   nobody      38    36  0 08:04 ?        00:00:04 nginx: worker process
   nobody      39    36  0 08:04 ?        00:00:00 nginx: cache manager process
   root        41    36  0 08:04 ?        00:00:04 nginx: privileged agent process
   root        84    48  0 08:51 pts/1    00:00:00 grep nginx`
   
   nginx.conf :
   `# Configuration File - Nginx Server Configs
   # This is a read-only file, do not try to modify it.
   
   master_process on;
   
   worker_processes auto;
   worker_cpu_affinity auto;
   
   error_log logs/error.log warn;
   pid logs/nginx.pid;
   
   worker_rlimit_nofile 20480;
   
   events {
       accept_mutex off;
       worker_connections 10620;
   }
   
   worker_rlimit_core  16G;
   
   worker_shutdown_timeout 240s;
   
   env APISIX_PROFILE;
   
   
   # main configuration snippet starts
   
   
   # main configuration snippet ends
   
   
   http {
       lua_package_path  "$prefix/deps/share/lua/5.1/?.lua;$prefix/deps/share/lua/5.1/?/init.lua;/usr/local/apisix/?.lua;/usr/local/apisix/?/init.lua;;/usr/local/apisix/?.lua;./?.lua;/usr/loca
   l/openresty/luajit/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/lua
   jit/share/lua/5.1/?/init.lua;";
       lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;$prefix/deps/lib/lua/5.1/?.so;;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/
   loadall.so;";
   
       lua_shared_dict plugin-limit-req     10m;
       lua_shared_dict plugin-limit-count   10m;
       lua_shared_dict prometheus-metrics   10m;
       lua_shared_dict plugin-limit-conn    10m;
       lua_shared_dict upstream-healthcheck 10m;
       lua_shared_dict worker-events        10m;
       lua_shared_dict lrucache-lock        10m;
       lua_shared_dict skywalking-tracing-buffer    100m;
       lua_shared_dict balancer_ewma        10m;
       lua_shared_dict balancer_ewma_locks  10m;
       lua_shared_dict balancer_ewma_last_touched_at 10m;
       lua_shared_dict plugin-limit-count-redis-cluster-slot-lock 1m;
       lua_shared_dict tracing_buffer       10m; # plugin: skywalking
       lua_shared_dict plugin-api-breaker   10m;
   
       # for openid-connect plugin
       lua_shared_dict discovery             1m; # cache for discovery metadata documents
       lua_shared_dict jwks                  1m; # cache for JWKs
       lua_shared_dict introspection        10m; # cache for JWT verification results
   
       # for custom shared dict
   
       # for proxy cache
       proxy_cache_path /tmp/disk_cache_one levels=1:2 keys_zone=disk_cache_one:50m inactive=1d max_size=1G use_temp_path=off;
   
       # for proxy cache
       map $upstream_cache_zone $upstream_cache_zone_info {
           disk_cache_one /tmp/disk_cache_one,1:2;
       }
   
       lua_ssl_verify_depth 5;
       ssl_session_timeout 86400;
   
       underscores_in_headers on;
   
       lua_socket_log_errors off;
   
       resolver 127.0.0.11 valid=30;
       resolver_timeout 5;
   
       lua_http10_buffering off;
   
       lua_regex_match_limit 100000;
       lua_regex_cache_max_entries 8192;
   
       log_format main escape=default '$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 logs/access.log main buffer=16384 flush=3;
       open_file_cache  max=1000 inactive=60;
       client_max_body_size 0;
       keepalive_timeout 60s;
       client_header_timeout 60s;
       client_body_timeout 60s;
       send_timeout 10s;
   
       server_tokens off;
   
       include mime.types;
       charset utf-8;
   
       real_ip_header X-Real-IP;
   
       set_real_ip_from 127.0.0.1;
       set_real_ip_from unix:;
   
       # http configuration snippet starts
   
   
       # http configuration snippet ends
   
       upstream apisix_backend {
           server 0.0.0.1;
           balancer_by_lua_block {
               apisix.http_balancer_phase()
           }
   
           keepalive 320;
       }
   
       init_by_lua_block {
           require "resty.core"
           apisix = require("apisix")
   
           local dns_resolver = { "127.0.0.11", }
           local args = {
               dns_resolver = dns_resolver,
           }
           apisix.http_init(args)
       }
   
       init_worker_by_lua_block {
           apisix.http_init_worker()
       }
   
   
       server {
           listen 9080 reuseport;
   
   
   
           # http server configuration snippet starts
   
   
           # http server configuration snippet ends
   
           set $upstream_scheme             'http';
           set $upstream_host               $host;
           set $upstream_uri                '';
   
           location = /apisix/nginx_status {
               allow 127.0.0.0/24;
               deny all;
               access_log off;
               stub_status;
           }
   
           location /apisix/admin {
                   allow 0.0.0.0/0;
                   deny all;
   
               content_by_lua_block {
                   apisix.http_admin()
               }
           }
   
           location /apisix/dashboard {
                   allow 0.0.0.0/0;
                   deny all;
   
               alias dashboard/;
   
               try_files $uri $uri/index.html /index.html =404;
           }
   
   
           location / {
               set $upstream_mirror_host        '';
               set $upstream_upgrade            '';
               set $upstream_connection         '';
   
               access_by_lua_block {
                   apisix.http_access_phase()
               }
   
               proxy_http_version 1.1;
               proxy_set_header   Host              $upstream_host;
               proxy_set_header   Upgrade           $upstream_upgrade;
               proxy_set_header   Connection        $upstream_connection;
               proxy_set_header   X-Real-IP         $remote_addr;
               proxy_pass_header  Date;
   
               ### the following x-forwarded-* headers is to send to upstream server
   
               set $var_x_forwarded_for        $remote_addr;
               set $var_x_forwarded_proto      $scheme;
               set $var_x_forwarded_host       $host;
               set $var_x_forwarded_port       $server_port;
   
               if ($http_x_forwarded_for != "") {
                   set $var_x_forwarded_for "${http_x_forwarded_for}, ${realip_remote_addr}";
               }
               if ($http_x_forwarded_proto != "") {
                   set $var_x_forwarded_proto $http_x_forwarded_proto;
               }
               if ($http_x_forwarded_host != "") {
                   set $var_x_forwarded_host $http_x_forwarded_host;
               }
               if ($http_x_forwarded_port != "") {
                   set $var_x_forwarded_port $http_x_forwarded_port;
               }
   
               proxy_set_header   X-Forwarded-For      $var_x_forwarded_for;
               proxy_set_header   X-Forwarded-Proto    $var_x_forwarded_proto;
               proxy_set_header   X-Forwarded-Host     $var_x_forwarded_host;
               proxy_set_header   X-Forwarded-Port     $var_x_forwarded_port;
   
               ###  the following configuration is to cache response content from upstream server
   
               set $upstream_cache_zone            off;
               set $upstream_cache_key             '';
               set $upstream_cache_bypass          '';
               set $upstream_no_cache              '';
               set $upstream_hdr_expires           '';
               set $upstream_hdr_cache_control     '';
   
               proxy_cache                         $upstream_cache_zone;
               proxy_cache_valid                   any 10s;
               proxy_cache_min_uses                1;
               proxy_cache_methods                 GET HEAD;
               proxy_cache_lock_timeout            5s;
               proxy_cache_use_stale               off;
               proxy_cache_key                     $upstream_cache_key;
               proxy_no_cache                      $upstream_no_cache;
               proxy_cache_bypass                  $upstream_cache_bypass;
   
               proxy_hide_header                   Cache-Control;
               proxy_hide_header                   Expires;
               add_header      Cache-Control       $upstream_hdr_cache_control;
               add_header      Expires             $upstream_hdr_expires;
               add_header      Apisix-Cache-Status $upstream_cache_status always;
   
               proxy_pass      $upstream_scheme://apisix_backend$upstream_uri;
   
               mirror          /proxy_mirror;
   
               header_filter_by_lua_block {
                   apisix.http_header_filter_phase()
               }
   
               body_filter_by_lua_block {
                   apisix.http_body_filter_phase()
               }
   
               log_by_lua_block {
                   apisix.http_log_phase()
               }
           }
   
           location @grpc_pass {
   
               access_by_lua_block {
                   apisix.grpc_access_phase()
               }
   
               grpc_set_header   Content-Type application/grpc;
               grpc_socket_keepalive on;
               grpc_pass         grpc://apisix_backend;
   
               header_filter_by_lua_block {
                   apisix.http_header_filter_phase()
               }
   
               body_filter_by_lua_block {
                   apisix.http_body_filter_phase()
               }
   
               log_by_lua_block {
                   apisix.http_log_phase()
               }
           }
   
           location = /proxy_mirror {
               internal;
   
               if ($upstream_mirror_host = "") {
                   return 200;
               }
   
               proxy_http_version 1.1;
               proxy_set_header Host $upstream_host;
               proxy_pass $upstream_mirror_host$request_uri;
           }
       }
   }`
   * apisix version (cmd: `apisix version`): 2.1
   * OS: Docker
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] leon1509 edited a comment on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
leon1509 edited a comment on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-738484975


   allready ok!已经总结到这:https://github.com/leon1509/note/blob/master/Docker%E5%AE%89%E8%A3%85apisix.md  


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] membphis commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737964122


   https://github.com/apache/apisix-dashboard/blob/v2.1/docs/deploy-with-docker.md#build
   
   # For users in mainland China, the `ENABLE_PROXY` parameter can be provided to speed up module downloads.
   $ docker build -t apisix-dashboard:$tag . --build-arg ENABLE_PROXY=true


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] leon1509 commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
leon1509 commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737832934


   > you can make a try with this branch: https://github.com/apache/apisix-dashboard/tree/v2.1.1
   apisix-dashboard 构建失败了!
   ![2](https://user-images.githubusercontent.com/4725850/100996021-899a7d80-3593-11eb-9cd7-1453211d2290.png)
   ![3](https://user-images.githubusercontent.com/4725850/100996034-8e5f3180-3593-11eb-992d-50d7091fc7a4.png)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] leon1509 closed issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
leon1509 closed issue #94:
URL: https://github.com/apache/apisix-docker/issues/94


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] membphis commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737790317


   @leon1509 if you want to use `Dashboard`, you need to use https://github.com/apache/apisix-dashboard, This is an independent project.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] nic-chen commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737856794


   > > you can make a try with this branch: https://github.com/apache/apisix-dashboard/tree/v2.1.1
   > > apisix-dashboard 构建失败了!
   > > ![2](https://user-images.githubusercontent.com/4725850/100996021-899a7d80-3593-11eb-9cd7-1453211d2290.png)
   > > ![3](https://user-images.githubusercontent.com/4725850/100996034-8e5f3180-3593-11eb-992d-50d7091fc7a4.png)
   
   you could try:
   ```sh
   docker build -t apisix-dashboard:v2.1.1 . --build-arg APISIX_DASHBOARD_VERSION=v2.1.1 --build-arg ENABLE_PROXY=true
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] leon1509 closed issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
leon1509 closed issue #94:
URL: https://github.com/apache/apisix-docker/issues/94


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] membphis commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737791543


   you can make a try with this branch: https://github.com/apache/apisix-dashboard/tree/v2.1.1


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] membphis edited a comment on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
membphis edited a comment on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-737964122


   https://github.com/apache/apisix-dashboard/blob/v2.1/docs/deploy-with-docker.md#build
   
   ```
   # For users in mainland China, the `ENABLE_PROXY` parameter can be provided to speed up module downloads.
   $ docker build -t apisix-dashboard:$tag . --build-arg ENABLE_PROXY=true


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-docker] leon1509 commented on issue #94: request help: Docker部署,无法访问dashboard!版本2.1

Posted by GitBox <gi...@apache.org>.
leon1509 commented on issue #94:
URL: https://github.com/apache/apisix-docker/issues/94#issuecomment-738484975


   allready ok!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org