Is this a valid config ?
Internet <->|Nginx front-end|<->|UDS|<->|Nginx back-end|<->|php UDS|<->|PHP Nextcloud|
If so, how to configure config.php accordingly ?
The idea is to have no network at all on back-end and php servers.
Just to improve security (paranoia) and speed by eliminating ip overhead between front-end and back-end servers.
Your assuming is correct, same host but using FreeBSD jails instead of Docker.
Problem seems that configuring Nextcloud trusted proxy is only possible with an IP address.
Oh, I also use a UNIX sockets for the Redis containers. I meant to include that on my “what I do” list.
You’re probably asking for a bit much to do it towards the proxy. Plus - even if you pull it off - you’d just end up with a nonstandard architecture that may have unintended consequences with likely minimal to no real-world benefit.
But I’d never discourage pushing and trying new things it one does it with their eyes wide open!