Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何获取客户端真实 IP? #471

Open
uwang opened this issue Apr 21, 2022 · 1 comment
Open

如何获取客户端真实 IP? #471

uwang opened this issue Apr 21, 2022 · 1 comment

Comments

@uwang
Copy link

uwang commented Apr 21, 2022

REMOTE_ADDR 恒为 172.18.0.1

@uwang
Copy link
Author

uwang commented Apr 22, 2022

系统 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 uwang changed the title 如何获取客户端真实 IP?REMOTE_ADDR 衡为 172.18.0.1 如何获取客户端真实 IP?REMOTE_ADDR 恒为 172.18.0.1 Jun 24, 2023
@uwang uwang changed the title 如何获取客户端真实 IP?REMOTE_ADDR 恒为 172.18.0.1 如何获取客户端真实 IP? Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant