nextcloud-docker-dev icon indicating copy to clipboard operation
nextcloud-docker-dev copied to clipboard

Support for multiple virtual hosts per service in nginx-proxy

Open smesterheide opened this issue 2 years ago • 5 comments

Currently the VIRTUAL_HOST environment variable is used by Nextcloud containers to derive an identifier for the instance among other things. This puts some limitations on how nginx-proxy can be used with regard to multiple virtual hosts.

I have a use case where I want to add an external reverse proxy on the web while also keeping the local setup intact. You can find a PoC here https://github.com/smesterheide/nextcloud-docker-dev/tree/app/vo-federation.

If there is interest in this I can create a PR where we disentangle the VIRTUAL_HOST environment variable.

smesterheide avatar Jun 30 '22 13:06 smesterheide

Ping #64

smesterheide avatar Jun 30 '22 13:06 smesterheide

With having a separate reverse proxy doesn't that also work without any adjustments of the nginx-proxys virtual host? I currently haven't seen any other use case but having a separate environment variable that can be set for a public alias would be fine with me as well.

juliusknorr avatar Jul 04 '22 10:07 juliusknorr

I guess it is mostly about https://github.com/smesterheide/nextcloud-docker-dev/blob/app/vo-federation/docker-compose.yml#L55-L57

juliusknorr avatar Jul 04 '22 10:07 juliusknorr

With having a separate reverse proxy doesn't that also work without any adjustments of the nginx-proxys virtual host?

I suppose it would work just the same if you have the additional reverse proxy connect to Nextcloud/Apache on port 8000 of the Docker host. Probably it is not a good idea to change the established environment variables for the majority of users if we do not have a clear use case.

smesterheide avatar Jul 04 '22 10:07 smesterheide

Relevant: https://github.com/nginx-proxy/nginx-proxy/issues/2148

rhansen avatar Jan 24 '23 16:01 rhansen