Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用以下方法获取 ip:
$request->getClientIp()
返回:
172.30.0.1而不是像210.110.98.180
172.30.0.1
210.110.98.180
在 docker-compose 中使用类似这样的东西
http: build: context: . dockerfile: ./Dockerfile volumes: - "./:/var/www/http/" ports: - "80:80"
通过将其添加到 docker 网络来修复它。
http: build: context: . dockerfile: ./Dockerfile volumes: - "./:/var/www/http/" ports: - "80:80" networks: - bridge2 networks: bridge2: external: true