dnmp icon indicating copy to clipboard operation
dnmp copied to clipboard

如何获取客户端真实 IP?

Open uwang opened this issue 2 years ago • 2 comments

REMOTE_ADDR 恒为 172.18.0.1

uwang avatar Apr 21 '22 16:04 uwang

系统 MacOS 12.1

➜  ~ docker --version
Docker version 20.10.12, build e91ed57
➜  ~ docker-compose --version
docker-compose version 1.29.2, build 5becea4c

docker-composer.yaml

version: "3"
services:
  nginx:
    build:
      context: ./services/nginx
      args:
        NGINX_VERSION: nginx:${NGINX_VERSION}
        CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
        NGINX_INSTALL_APPS: ${NGINX_INSTALL_APPS}
    container_name: nginx
    ports:
      - mode: host
        protocol: tcp
        published: ${NGINX_HTTP_HOST_PORT}
        target: 80
      - mode: host
        protocol: tcp
        published: ${NGINX_HTTPS_HOST_PORT}
        target: 443

uwang avatar Apr 22 '22 02:04 uwang