有可能通过在docker中运行apache来获得远程ip

我已经在Docker中创build了一个Apache服务器,但是我在访问日志中得到的ip是从我的docker ip,而不是从远程客户端ip。

是否有可能获得远程IP?

我已经尝试使用mod_remoteip,这是行不通的。

Dockerfile

FROM ubuntu:latest ENV DEBIAN_FRONTEND noninteractive # make sure the package repository is up to date and update ubuntu RUN locale-gen de_DE.UTF-8 RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7 RUN apt-get update && apt-get install -y apt-transport-https ca-certificates RUN apt-get update && apt-get install -y curl lsb-release supervisor openssh-server libapache2-mod-passenger git apache2 vim # supervisor installation && # create directory for child images to store configuration in RUN apt-get -y install supervisor && \ mkdir -p /var/run/sshd && \ mkdir -p /var/log/supervisor && \ mkdir -p /etc/supervisor/conf.d # default command CMD ["/usr/bin/supervisord"]