linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
785 stars 108 forks source link

[FEAT] Nginx log with real client IP #229

Open rochafabrizio opened 1 week ago

rochafabrizio commented 1 week ago

Is this a new feature request?

Wanted change

Bookstack container also provides a web server powered by nginx. However its access logs shows the ip address of the reverse proxies in front of it. It would be much better if there were a way to provide the trusted proxies, so nginx logs the client IP.

Reason for change

The way it is, nginx is logging the IP of reverse proxy in front of the docker, not the real client IP.

Proposed code change

No response

github-actions[bot] commented 1 week ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

j0nnymoe commented 1 week ago

The container will already do this, the issue will be your host ke your proxy that is stripping that data. For example on Synology boxes you have to adjust iptables to enable it.

rochafabrizio commented 1 week ago

Hi j0nnymoe, I noticed env var APP_PROXIES, don't know if thats what you mean, eitherway I'm setting it and it's only helping with Audit Log page. Please, let me know if there is any doc / article I can use. Thanks.

j0nnymoe commented 1 week ago

Without knowing your setup, I'm just making assumptions but this was the specific thing I was speaking about for Synology https://www.pedrolamas.com/2020/11/04/exposing-the-client-ips-to-docker-containers-on-synology-nas/

kristiandg commented 3 days ago

That worked for me. Hosting on Azure App Services, when I added the Env Variable "APP_PROXIES=*", I'm now getting client IPs in the audit log.