Using caching proxy to speed up publicly shared calendar

Continuing the discussion from How to use caching reverse proxy with NextCloud, problems with NC setting "cache-control":

Hello @kbyrd,

I am facing a very similar issue but in a more restricted way. I want to share a calendar using NC publicly for reading. This can be done for sure.

The problem is that the shared page takes multiple seconds to load. The NC server hardware is not high end but sufficient (only the internal cloud of a non-profit association which needs to be careful with financial costs). The only thing is this publicly shared calendar that is to be shown on our homepage.

The idea was to add a reverse caching proxy like nginx to the NC on a VPS or something like this. Then, the website could use the cached version. This has the benefit that the files can be served quicker from the cache. Additionally, the NC URL is not directly published on the homepage, reducing the attack surface minimally (avoid scrapers to find the NC in a very trivial way).

I am aware that the homepage might be a bit outdated in this case but this is perfectly fine as the changes in the calendar will be done mainly once a year plus some changes from time to time.

For this use-case it is essential that the NC is still reachable directly without the reverse proxy. Thus, I cannot change the complete structure and access methods.

I am not yet facing actual problems, I am just doing some research. So, I am interested in your results and the configuration you used (both on nginx as well as NC side (trusted_proxy mainly). Could you share this? Do you have any more hints, experiences, or suggestions?

Thanks a lot for your help and insight!
Christian

Nextcloud version (eg, 20.0.5): 28
Operating system and version (eg, Ubuntu 20.04): community docker image
Apache or nginx version (eg, Apache 2.4.25): community dockerr image
PHP version (eg, 7.4): community docker image