juliushaertl / nextcloud-docker-dev

Nextcloud development environment using docker-compose
GNU Affero General Public License v3.0
134 stars 70 forks source link

Support for multiple virtual hosts per service in nginx-proxy #72

Open smesterheide opened 2 years ago

smesterheide commented 2 years ago

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 commented 2 years ago

Ping #64

juliushaertl commented 2 years ago

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.

juliushaertl commented 2 years ago

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

smesterheide commented 2 years ago

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.

rhansen commented 1 year ago

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