monicahq / docker

docker image of Monica
https://hub.docker.com/_/monica/
GNU General Public License v2.0
203 stars 61 forks source link

Option to log the real IP if behind a reverse proxy? #108

Closed chmac closed 2 years ago

chmac commented 2 years ago

I'm running a monica docker container behind a separate SSL proxy. I've set the proxy's IP in the APP_TRUSTED_PROXIES variable. When I look at my logs in docker, I get the IP of the proxy showing up and not my client's actual IP. Is there any way to fix that by setting some other environment variable or otherwise?

asbiin commented 2 years ago

You need to setup a proper reverse proxy. The APP_TRUSTED_PROXIES setting is on the application side, and not on the docker container level.

chmac commented 2 years ago

My reverse proxy works fine. Apache can be configured to log either the connecting IP or the IP provided by the reverse proxy. Currently it's logging the connecting IP, which is likely not so useful in a docker context.

You closed the ticket as completed, does that mean you're not open to adding this option?

With the current setup the logs are not so useful as all requests have the same IP...