Frequently Asked Questions

This document covers common technical questions and answers about using Apache APISIX.

Basic Questions

What is Apache APISIX?

Apache APISIX is a top-level project under the Apache Software Foundation. It is a cloud-native API gateway known for its dynamic, real-time, and high-performance characteristics, providing dynamic routing, dynamic upstreams, dynamic certificates, A/B testing, gray release, rate limiting, attack protection, monitoring, and alerts.

What's the difference between APISIX and Nginx?

Nginx is a traditional web server and reverse proxy, while APISIX is an API gateway built on Nginx. APISIX adds fully dynamic configuration management, a rich plugin system, fine-grained traffic control, and built-in observability features on top of Nginx.

How is APISIX's performance?

APISIX inherits Nginx's high-performance characteristics while maintaining efficient processing through optimizations and the plugin mechanism. Actual performance depends on hardware configuration and business complexity, typically handling tens of thousands to hundreds of thousands of requests per second.

Installation Issues

What to do if Docker fails to start?

  1. Check if Docker is running: docker ps
  2. View container logs: docker-compose logs apisix
  3. Common issues:
    • Port conflicts: Check if ports 9080, 9180, 9443 are in use
    • etcd connection failure: Confirm etcd container is running
    • Permission issues: Ensure you have sufficient permissions to run Docker

How to check APISIX version?

curl "http://127.0.0.1:9080" --head | grep Server

Returns: Server: APISIX/Version

Cannot access Dashboard after installation?

  1. Confirm Dashboard port mapping (default 9180)
  2. Check firewall settings
  3. Confirm container network configuration

Configuration Issues

How to modify Admin API port?

Edit apisix.yml:

deployment:
  admin:
    listen:
      host: 0.0.0.0
      port: 9180

How to enable HTTPS?

  1. Configure SSL certificate:
curl -i "http://127.0.0.1:9180/apisix/admin/ssl" -X PUT -d '
{
  "cert": "certificate content",
  "key": "private key content",
  "snis": ["example.com"]
}'
  1. Enable HTTPS in route:
{
  "plugins": {
    "proxy-rewrite": {
      "scheme": "https"
    }
  }
}

Route configuration not taking effect?

  1. Check if route configuration is correct
  2. Confirm etcd synchronization
  3. Check for plugin syntax errors
  4. Check APISIX error logs

How to implement CORS?

Use the cors plugin:

{
  "plugins": {
    "cors": {
      "allow_origins": "*",
      "allow_methods": "GET,POST,PUT,DELETE",
      "allow_headers": "*"
    }
  }
}

Performance Issues

How to improve throughput?

  1. Increase worker processes: apisix.worker_processes: auto
  2. Enable HTTP/2: Set http2: true in listen configuration
  3. Optimize upstream connection pool: Configure keepalive_pool.size
  4. Use cache plugin: Enable proxy-cache plugin

High memory usage?

  1. Reduce unnecessary plugin loading
  2. Limit upstream connections
  3. Adjust log buffer size
  4. Use streaming for large files

Feature Questions

How to implement A/B testing?

Use the traffic-split plugin:

{
  "plugins": {
    "traffic-split": {
      "rules": [
        {
          "weight": 30
        },
        {
          "weight": 70,
          "upstream_id": "upstream-v2"
        }
      ]
    }
  }
}

How to implement rate limiting?

Use the limit-req plugin:

{
  "plugins": {
    "limit-req": {
      "rate": 100,
      "burst": 50,
      "key": "remote_addr"
    }
  }
}

Integration Questions

How to integrate with Kubernetes?

Use APISIX Ingress Controller:

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: example-route
spec:
  http:
    - name: example
      match:
        paths:
          - /api/*
        methods:
          - GET
      backends:
        - serviceName: example-service
          servicePort: 8080

How to integrate with Prometheus?

  1. Enable Prometheus plugin
  2. Configure Prometheus scrape config

Security Questions

How to prevent APISIX abuse?

  1. Enable authentication: Enable key-auth or other auth plugins on all routes
  2. Restrict Admin API access: Only allow trusted IPs to access Admin API
  3. Use HTTPS: Enable TLS encryption
  4. Configure rate limiting: Prevent malicious requests
  5. Enable access logging: Log all requests for auditing

How to enable Admin API authorization?

deployment:
  admin:
    admin_key_required: true

Operations Questions

How to upgrade APISIX?

Docker:

docker-compose pull
docker-compose up -d

Kubernetes:

helm upgrade apisix apisix/apisix

Common Error Codes

  • 401 Unauthorized: Authentication failed
  • 403 Forbidden: No access permission
  • 404 Not Found: Route does not exist
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Upstream service error
  • 502 Bad Gateway: Upstream service unavailable
  • 503 Service Unavailable: Service unavailable

More Help