erseco / alpine-moodle

Moodle docker image based on Alpine Linux
https://hub.docker.com/r/erseco/alpine-moodle
MIT License
42 stars 33 forks source link

Users real IP #11

Closed lupa18 closed 2 years ago

lupa18 commented 2 years ago

Hi ! how are you! I'm trying users can see their actual IP. I'm not sure if is a container nginx issue or my apache proxy configuration. Is it possible or make sense to add this configuration to nginx?

proxy_set_header  Host              $http_host;   # required for docker client's sake
proxy_set_header  X-Real-IP         $remote_addr; # pass on real client's IP
proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for; 

(source: https://forums.docker.com/t/nginx-cannot-get-to-client-ip/52602/6)

thanks in advance !

erseco commented 2 years ago

You should configure this in your balancer for more security. If you are using this in a secure environment, you can use this container as base and override the configuration

FROM erseco/alpine-moodle:beta
USER root
COPY ./nginx.conf /etc/nginx/nginx.conf
USER nobody

And modify the nginx.conf file to fit your needs

Best regards!