Linux Format

Adding a reverse proxy to Nextcloud

If you followed part one of this tutorial (it’s on the archive, https://linuxformat.com/archives, available to all) you should have a working install of Nextcloud running in a Docker container, along with a supporting container running MariaDB. Assuming you configured port forwarding entries on your router, you should also be able to access this Nextcloud server from outside your home network. This is great, but one of the main advantages of using Docker is that it’s really easy to add extra containers; however, only one of these can listen on a given TCP port (such as TCP/443, for secure web connections).

One solution is to configure port forwarding entries for each container (such as TCP/443 for Nextcloud, TCP/444 for a wiki, etc.). This approach has a number of problems, not least that some locations might block your access to non-standard web ports; many corporate or educational networks limit access to TCP/80 and TCP/443, for example.

Another way to solve the problem is to use a reverse proxy, which is a service that listens for web requests

(e.g. TCP/80 or TCP/443), and then retrieve the requested content from Nextcloud, wiki or similar. Reverse proxies have been around for a long time, and the two most popular web servers (Apache and Nginx) can both work this way. For this), which is an open source edge router; it offers both traditional reverse-proxy services, along with many other features. Among its many impressive features, Traefik is Docker-aware (as well as many other container platforms), meaning that it can discover containers automatically, and you can configure it using the same docker-compose tool we used in part 1 of the tutorial.

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format1 min read
Vector Vexations
Why does MySQL not support vectors in its community edition? Generative AI is the hot topic in tech. GenAI relies on vector data. Yet Oracle has no plans to support vectors in the community edition of MySQL. If you want to try out vector data with ot
Linux Format5 min read
Tips For Managing Docker Containers
Everyone knows how containers revolutionised application building and deployment. Using a E disposable stack of containers that make up an app that aren’t using the docker-compose command to manage the stack are missing a trick. It allows the shippin
Linux Format1 min read
Wine For Wayland
2023 was a great year for the Wayland driver for Wine. The goal was to move forward from the experimental phase and make the driver a proper upstream component. A year later, after several merge requests, many people are now already able to use the l

Related