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/06/10 13:55:04 UTC

[GitHub] [incubator-apisix] zheng11581 opened a new issue #1689: Use ipv4 API turn out 403 error

zheng11581 opened a new issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689


   ### Issue description
   1. vim /deploy/apisix/conf/config.yaml
     allow_admin:                  # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
       - 0.0.0.0/0              # If we don't set any IP list, then any IP access is allowed by default.
   2. make reload
   3. curl -i http://172.17.232.117:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   HTTP/1.1 403 Forbidden
   Date: Wed, 10 Jun 2020 13:54:06 GMT
   Content-Type: text/html
   Content-Length: 150
   Connection: keep-alive
   Server: APISIX web server
   
   <html>
   <head><title>403 Forbidden</title></head>
   <body>
   <center><h1>403 Forbidden</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>
   
   
   ### Environment
   Ubuntu 16.04
   
   * apisix version (cmd: `apisix version`): 1.3
   * OS: Ubuntu 16.04
   


----------------------------------------------------------------
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] [incubator-apisix] moonming commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-642412985


   Is the `X-API-KEY` same as `conf/config.yaml`?


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-643038842


   > Is the `X-API-KEY` same as `conf/config.yaml`?
   yes, they are same
   


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-646938774


   no i didn't.


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1689: Use ipv4 API turn out 403 error

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


   please provide your full file `conf/config.yaml`, I can not reproduce your bug.
   it works fine at my local machine.
   
   ```diff
   diff --git a/conf/config.yaml b/conf/config.yaml
   index cee95a60..3a122a37 100644
   --- a/conf/config.yaml
   +++ b/conf/config.yaml
   @@ -51,7 +51,7 @@ apisix:
      #    cache_levels: "1:2"
   
      allow_admin:                  # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
   -    - 127.0.0.0/24              # If we don't set any IP list, then any IP access is allowed by default.
   +    - 0.0.0.0/0              # If we don't set any IP list, then any IP access is allowed by default.
      #   - "::/64"
      # port_admin: 9180              # use a separate port
      # https_admin: true             # enable HTTPS when use a separate port for Admin API.
   ```
   
   ```shell
   $ curl -i http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   HTTP/1.1 200 OK
   Date: Sat, 20 Jun 2020 09:02:15 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   Server: APISIX web server
   
   ... ...
   ```


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-647084374


   curl -i http://REAL_IP:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   
   Can you try this? I mean I want to call the Logic API or Admin API from other server not local host


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1689: Use ipv4 API turn out 403 error

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


   > I mean I want to call the Logic API or Admin API from another server not localhost
   
   please confirm you only run one APISIX instance. 
   
   if you are running more instances, it will be wrong. you can use `ps -ef | grep openresty` to confirm.


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-647212783


   ![image](https://user-images.githubusercontent.com/30709347/85239855-58f0dc80-b468-11ea-8203-6ed1dfed379b.png)
   
   vim /deploy/apisix/conf/nginx.conf
   
   ![image](https://user-images.githubusercontent.com/30709347/85239961-cf8dda00-b468-11ea-8b7e-fefc833c2fdb.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] [incubator-apisix] zheng11581 closed issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 closed issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689


   


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1689: Use ipv4 API turn out 403 error

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


   
   ```yaml
   # conf/config.yaml
   # ... ...
     allow_admin:                  # http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
       - 0.0.0.0/0              # If we don't set any IP list, then any IP access is allowed by default.
     #   - "::/64"
     # port_admin: 9180              # use a separate port
     # https_admin: true             # enable HTTPS when use a separate port for Admin API.
                                     # Admin API will use conf/apisix_admin_api.crt and conf/apisix_admin_api.key as certificate.
   
   ```
   
   it works fine too.
   
   ```shell
   $ curl -i http://172.16.192.132:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   HTTP/1.1 200 OK
   Date: Sun, 21 Jun 2020 08:32:00 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   Server: APISIX web server
   ```


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-643039323


   the error.log only post something like below.
   2020/06/12 11:05:26 [error] 5546#5546: *12593642 access forbidden by rule, client: 172.17.232.117, server: , request: "GET /apisix/admin/routes HTTP/1.1", host: "172.17.232.117:9080"


----------------------------------------------------------------
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] [incubator-apisix] Miss-you commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
Miss-you commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-642814404


   Can you post the log of error.log?
   We need more logs to determine what the problem is.


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1689: Use ipv4 API turn out 403 error

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


   please confirm you have updated `conf/config.yaml`:
   
   ![image](https://user-images.githubusercontent.com/6814606/85240037-4034f680-b469-11ea-906c-bcaeb2d6fa6f.png)
   
   after you updated `conf/config.yaml`, please call `make init` to update your nginx.conf .
   
   then you can reload your APISIX server.


----------------------------------------------------------------
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] [incubator-apisix] zheng11581 commented on issue #1689: Use ipv4 API turn out 403 error

Posted by GitBox <gi...@apache.org>.
zheng11581 commented on issue #1689:
URL: https://github.com/apache/incubator-apisix/issues/1689#issuecomment-647551707


   haha,it works. thanks lot.


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1689: Use ipv4 API turn out 403 error

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


   @zheng11581 do you have fixed?


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