I will try to be as succinct as I can. I have AIO running on one host using an nginx reverse proxy on another host. I have a split dns setup so internal requests are given internal addresses using unbound on both the AIO host and the Nginx host.
My logs have errors like this:
Dec 29 12:58:42 toto nginx: 2023/12/29 12:58:42 [warn] 10985#0: *18302 upstream sent duplicate header line: “Server: Apache/2.4.58 (Unix)”, previous value: “Server: Caddy”, ignored while reading r
esponse header from upstream, client: 192.168.1.3, server: cloud2.genashor.com, request: “GET /apps/richdocuments/settings/fonts.json HTTP/1.1”, upstream: “http://192.168.1.3:11000/apps/richdocuments/settings/fonts.json”, host: “cloud2.genashor.com”
I’ve tried everything I could find but can’t seem to identify why this is happening. A question is the client address. 192.168.1.3 is the AIO host. Other lines have 192.168.1.1 which is the router IP. Does this indicate that I’ve set up my nginx proxy incorrectly so it’s reporting the wrong client address?
funny thing I was seeing this issue for long time.
Nextcloud and Collabora running on the same Docker host where talking to each other using public IP despite the fact working splitbraindns was in place and internal client, internet router and Docker host itself resolved the dns records to the local IP of the Docker host. I didn’t find the root cause - likely it it lies somewhere in the depth of routing and iptables used when you setup Docker containers.
long story short - I played a little with internal Docker DNS and found a good workaround - just add all the public DNS records as alias to reverseproxy container. for details look here
This sounds very promising and actually makes some sense since my nginx machine’s IP has multiple “virtual” domain names assigned to it. Reverse lookup might pick the wrong one.
I gave it a go but I can’t seem to figure out where to set the aliases. I put this in my docker-compose.yml but it complains that I can’t assign the attribute aliases.
Bottom line, everything is functioning fine. I suppressed the nginx warnings by moving the log level from warn to error. My guess is that others would have complained if they had nginx set to output at warn level. I also discovered the problem with the strange ip address in the warnings. I had to remove the X-Real-IP header sent by nginx as docker seems to handle this incorrectly.