Can't figure out caddy as reverse proxy for filebrowser

1. The problem I’m having:

I have home server with network IP 192.168.1.102
I’m running Filebrowser on my home server on port 8081
I want to use caddy on same machine as reverse proxy to add HTTPS support
I have dyndns setup for my dynamic ip.
Both 8081 and 8089 are port forwarder on home router.

I was trying to setup caddy on 8089 port.
The certificate issuing didn’t work until I opened portforwarded ports 80 and 443. The router informed me the web access port will be moved to 8080.
As I understand from reading the forums I can’t use a custom HTTPS port with external certificate authorities? Am I correct?

2. Error messages and/or full log output:

2024/10/27 10:45:01.541 ERROR   http.log.error  dial tcp: lookup --from: no such host   {"request": {"remote_ip": "192.168.1.1", "remote_port": "3256", "client_ip": "192.168.1.1", "proto": "HTTP/2.0", "method": "GET", "host": "murmur.hopto.org", "uri": "/", "headers": {"Cache-Control": ["max-age=0"], "Sec-Ch-Ua": ["\"Chromium\";v=\"130\", \"Google Chrome\";v=\"130\", \"Not?A_Brand\";v=\"99\""], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Fetch-Site": ["none"], "Dnt": ["1"], "Sec-Fetch-Mode": ["navigate"], "Accept-Language": ["en-US,en-GB;q=0.9,en;q=0.8,hr-HR;q=0.7,hr;q=0.6"], "User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"], "Sec-Fetch-User": ["?1"], "Priority": ["u=0, i"], "Accept-Encoding": ["gzip, deflate, br, zstd"], "Sec-Ch-Ua-Platform": ["\"Windows\""], "Upgrade-Insecure-Requests": ["1"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"], "Sec-Fetch-Dest": ["document"]}, "tls": {"resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "murmur.hopto.org"}}, "duration": 2.7024262, "status": 502, "err_id": "k3uavt5ea", "err_trace": "reverseproxy.statusError (reverseproxy.go:1269)"}

3. Caddy version:

v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=

4. How I installed and ran Caddy:

Copied to C:\Programs and executed caddy run

a. System environment:

Windows 11

b. Command:

caddy run

d. My complete Caddy config:

murmur.hopto.org {
	reverse_proxy --from :443 --to :8081
}

That’s not valid syntax. You used the CLI syntax (like when you run commands in your terminal), not Caddyfile syntax.

You want reverse_proxy localhost:8081

1 Like

I don’t think --from and --to are valid in Caddyfile, only on the command line.

1 Like

Snap, @francislavoie :slight_smile:

1 Like

OK, I started
caddy reverse-proxy --from :443 --to :8081
without caddyfile

This site can’t provide a secure connection

murmur.hopto.org sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

Then I started
caddy run
with Caddyfile
murmur.hopto.org {
reverse_proxy localhost:8081
}
This seems to work. It opened the webpage.

Now my question is can I put two web servers and have caddy direct correctly? I can’t use different ports for HTTPS?

Yes. But for that, subdomains are recommended.

You can use different ports for HTTPS, but that’s the worst option. Using subdomains is better because you have an actual name you can type instead of a number.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.