How to set reverse proxy using Caddy
Due to the long distance and bad route of my server which holds Navidrome and Nextcloud, the usage of them is not always pleased. In order to get a smooth experience, I decided to set a reverse proxy for them using my best route server. For a certain reason, I must use Caddy as my web server for reverse proxy.
How to set
Assume that your reserve proxy server domain is reverse.com, your Navidrome server is navidrome.com, your Nextcloud server is nextcloud.com .
For Navidrome
Edit your Caddyfile
1 | reverse.com { |
1 | caddy reload --config Caddyfile_path |
For Nextcloud
This differs from the former as it needs additional settings.
Log into your server which holds Nextcloud.
1 | vim /var/www/nextcloud/config/config.php |
1 | 'trusted_domains' => |
Then exit and log into your reverse proxy server as root.
Edit your Caddyfile
1 | reverse.com { |
1 | caddy reload --config Caddyfile_path |