xiak commented on issue #9033:
URL: https://github.com/apache/apisix/issues/9033#issuecomment-2826198200

   any update?
   
   if APISIX and consul in one docker compose network, they can use service 
name to visit each other.
   
   But 502 
   
   2025-04-24 11:14:25 2025/04/24 03:14:25 [error] 72#72: *391603 [lua] 
balancer.lua:388: run(): failed to set server peer [:8080] err: no host while 
connecting to upstream, client: 172.31.0.1, server: _, request: "GET /sw-ui 
HTTP/1.1", host: "127.0.0.1:9080"
   2025-04-24 11:14:26 172.31.0.14 - - [24/Apr/2025:03:14:23 +0000] apisix:9080 
"GET /-/health HTTP/1.1" 200 13 0.000 "-" "Consul Health Check" - - - 
"http://apisix:9080";
   2025-04-24 11:14:28 172.31.0.1 - - [24/Apr/2025:03:14:25 +0000] 
127.0.0.1:9080 "GET /sw-ui HTTP/1.1" 502 631 0.000 "-" "Mozilla/5.0 (Windows NT 
10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 
Safari/537.36"  - 0.000 "http://127.0.0.1:9080/sw-ui";
   
   consul config:
           {
             "name": "sw-ui",
             "port": 8080,
             "check": {
               "http": "http://sw-ui:8080/config.json";,
               "interval": "10s"
             }
           },
   
   docker compose config
     sw-ui:
       image: ${SW_UI_IMAGE}
       networks:
         - ads
       ports:
         - "${SW_UI_PORT}:8080"
       depends_on:
         sw-oap:
           condition: service_healthy
       environment:
         SW_OAP_ADDRESS: http://sw-oap:12800
         SW_CONSUL_ADDRESS: http://consul:8500
         SW_CONSUL_ENDPOINT: /v1/kv/ads/skywalking/ui/config.json?raw
   
     consul:
       image: ${CONSUL_IMAGE}
       container_name: consul
       environment:
         CONSUL_LOCAL_CONFIG: |
           {
             "verify_incoming": false,
             "verify_outgoing": false
           }
       command: agent -server -bootstrap-expect=1 -data-dir=/consul/data -ui 
-bind=0.0.0.0 -client=0.0.0.0
       ports:
         - "${CONSUL_PORT}:8500"
       expose:
         - "8300"  # RPC
         - "8301"  # Serf LAN
         - "8302"  # Serf WAN(可选)
   
         - "8600"  # DNS
       volumes:
         - ./discovery/data:/consul/data
       networks:
         - ads
     apisix:
       image: apache/apisix:3.12.0-debian
       restart: always
       volumes:
         - ./gateway/apisix/config.yaml:/usr/local/apisix/conf/config.yaml:ro
       depends_on:
         - etcd
       ##network_mode: host
       # 外部网络
       ports:
         - "${APISIX_ADMIN_PORT}:9180/tcp"
         - "${APISIX_PORT}:9080"
         # - "9091:9091/tcp"
         # - "9443:9443"
         # - "9092:9092/tcp"
       expose:
         - "9081"
         - "9091"
         - "9443"
         - "9092"
       networks:
         - ads


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

Reply via email to