1. The problem I’m having:
Hello,
I tried to setup a reverse proxy to access a nextcloud, and homeassistant from the internet. For this I have a domain at Ionos and some subdomains. Starting point is the nextcloud, which is accessable from the internet. For this alone no reverse proxy is necessary of course.
By experimenting hours and hours with no real success I went back to the basics: a bare Raspberry Pi 3b with latest Raspbian, all updates and started a Quick-start session according to Reverse proxy quick-start — Caddy Documentation.
When succeeding in this “simple” problem, I’ll go back to my original task. However, first I would like to understand the basics.
At the point ‘static files’ . At this point there is a home directory /var/www/caddypi with a simple index.html, but no Caddyfile nor caddy.json config. The commands ‘caddy file-server --listen :2015’ and ‘curl localhost:2015’ work as expected. Now with Caddyfile:
localhost:2015
file_server browse
This command fails:
uli@caddy:/var/www/caddypi $ caddy run
And of course, the site does not work:
uli@caddy:/var/www/caddypi $ curl localhost:2015
2. Error messages and/or full log output:
caddy run →
2024/11/10 13:30:02.886 INFO using adjacent Caddyfile
2024/11/10 13:30:02.890 INFO adapted config to JSON {“adapter”: “caddyfile”}
2024/11/10 13:30:02.893 INFO admin admin endpoint started {“address”: “localhost:2019”, “enforce_origin”: false, “origins”: [“//localhost:2019”, “//[::1]:2019”, “//127.0.0.1:2019”]}
2024/11/10 13:30:02.894 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {“server_name”: “srv0”}
2024/11/10 13:30:02.894 INFO tls.cache.maintenance started background certificate maintenance {“cache”: “0x40006ad200”}
2024/11/10 13:30:02.896 INFO pki.ca.local root certificate is already trusted by system {“path”: “storage:pki/authorities/local/root.crt”}
2024/11/10 13:30:02.897 INFO tls.cache.maintenance stopped background certificate maintenance {“cache”: “0x40006ad200”}
Error: loading initial config: loading new config: http app module: start: listening on :80: listen tcp :80: bind: permission denied
curl localhost:2015
curl: (7) Failed to connect to localhost port 2015 after 1 ms: Couldn’t connect to server
My question: how to interpret the error message. I have no other web server running.
3. Caddy version:
v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
4. How I installed and ran Caddy:
Strictly following the Installation process on Welcome — Caddy Documentation.
No Docker.
a. System environment:
Raspberry Pi3b, 64GB Flash, 64Bit RasbianOS,
Linux caddy 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64
b. Command:
see above.
c. Service/unit/compose file:
Not relevant for now.
d. My complete Caddy config:
localhost:2015
file_server browse