Nextcloud AIO Apache configuration - port forwarding

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 34.0.3
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux 6.18.39+rpt-rpi-2712 aarch64
  • Web server and version (e.g, Apache 2.4.25):
    • Apache
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO with Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I want to modify the Apache webserver and cannot find a proper way to do this.

My Nextcloud AIO instance is running well and i can connect it from the outside. So far so good. Now i have added a Open WebUI server on a Mac in the local network, listening on 192.168.x.x:3000. My aim is it to change the Apache config file that Apache ist forwarding all the ports for Nextcloud (80, 8080, 443) from nextcloud.mydomain.com to the home server 192.168.1.100 and all requests on port 3000 to 192.168.1.101.

Is it correct to open a shell in the container?

docker exec -it nextcloud-aio-apache sh

in the directory conf I’ve found a nextcloud.conf file. Unfortunately RO. How can i write there? Sudo does not work. And the adding the following block below should work?

<VirtualHost *:3000> 
  ProxyPreserveHost On
  ProxyRequests Off
  ServerName nextcloud.mydomain.com
  ServerAlias nextcloud.mydomain.com 
  ProxyPass / http://192.168.1.101:3000
  ProxyPassReverse / http://localhost:8080/example/
</VirtualHost> 

Thank you for helping a complete noob in the game.

Hi, unfortunately it is not possible to modify the apache config as you already found out.

However what you could possibly do instead is to simply port-forward the port in your router instead: so basically map the external port 3000 to 192.168.1.101:3000, no?

Thank you for the hint. I’ve tried, but unfortunately it did not work. Is there no way to edit the apache config at all? Not even as parameters in the docker compose yml file?

What you could try is switching to the caddy community container: all-in-one/community-containers/caddy at main · nextcloud/all-in-one · GitHub. This one allows to edit some of its configuration.

It does sound like you would benefit from using a standalone reverse proxy that takes care of the routing for you, instead of modifying the one already inside of your container stack.

If you put a small apache or caddy container in front of both AiO and openwebui, you can route traffic that way (external reverse proxy). Here is a doc from the repo on just this

Although, it of course depends on how you have sat up AiO and if you depend on the bundled certificate generation (https) and other things - which you will have to manage on your own if you use your own reverse proxy in front of Nextcloud AiO.

I’ve installed Caddy as proposed and it works. But the way to success was a hard one. Setting up two additional subdomains and changing the DNS setting was easy. Installing Caddy not an issue. But it was hard to understand that only caddy has to listen to port 80 and 443. The internal Apache has to be reconfigured to port 11000, Open WebUI to 3000 and paperless to 8010. Three evenings later everything is working fine.