Docker and https howto?


i’m trying to understand all the howtos about docker and nextcloud using https.
Most of them using nginx and the redirection from http to https.

When I’m using docker and the official nextcloud container just http is running.
Which means I can reach nextcloud via http: and port 80, but no connection via https on port 443 is possible.
As far as I understand it for the redirection with nginx it is an prerequisite that the https service is available.

… What is my misunderstanding? And how can i use nextcloud via docker over https?


there are two possible nginx container you might be talking about.

  1. the nextcloud image with php-fpm only has php “onboard”. but fpm-php can’t handle static html and css. in this scenario nginx is serving html & css. all requests for php pages are uploaded to the fpm-php container. but that container only talks http.

  2. to talk ssl/tls you need certificates. if you use letsencrypt they have to renewed regularly. so people build a nginx+letsencrypt container with certificate auto renew.

kind of job sharing. 1. handles nextcloud. 2. handles https.

of course you can combine both. but than you have to be a nextcloud expert and a letsencrypt expert to maintain that dockerfile. and you have to use letsencrypt certificates where you want to use versign certs. so better t keep things separated.

and if you want to run other container with web service (wordpress, joomla, …) on that host things are getting even more complicate.

p.s.: in my playbook you can choose apache or nginx/fpm-php to run nextcloud. but i put traefik in front of it. if you want to add other web services to your host you just have to tag that container and traefik will get certificates and add a route to that container.if traefik can’t get letsencrypt certifcates it uses selfsigned ones. automatically.

Thanks for your reply.

Im running the standard nextcloud container with apache. But as described that container is just using http (whyever).

Certificates are another topic.

At the moment I’m still stopped at the point “Who and how is converting the http from the nextcloud/apache to https”?
Who I think will be nginx
But I didn’t find an working example…

Look for reverse proxy.
Then you only need to setup nginx as https server and do a translation
http(nextcloud) :left_right_arrow: https(nginx)

Any working examples?
docker-composer.yaml, nginx config?


google-search: nginx reverse-proxy setup

I can only show an apache example - because I don’t use nginx

Well thanks - As I’m said earlier I tried a lot of howtos…

How do you use apache with the nextcloud container?

Id on’t have a nextcloud container.
But I use a collabora office container
There I use a reverse proxy setup