Remote index.html

Hi guys, I am trying to get my Caddy running using a remote index.html. The objective is to bind this file with my localhost. Let’s admit that the index.html I want to use (and all the files relatives to it), I want Caddy to use this file as it’s index.html

I have the following Caddyfile

localhost:2020

And I run Caddy using the command
./caddy -conf="192.168.100.82:9000/index.html
When I type this address on my browser I can successfully access the website but when I run Caddy all I got is
404 not found

Any advice ? Am I doing it wrong ?
Thanks, Alexi

Hey Alexi, it looks like you’re trying to load the Caddyfile over the network - Caddy doesn’t currently support that. That might be a bug, I’ll have to look into this. We changed how the Caddyfile gets loaded in 0.9 so it’s probably something in the design about error reporting…

Thanks for the reply Matt ! The Caddyfile is on my computer, but indeed, I would like to get the index.html and all the related stuff to be either copied on my computer or at least using those file (download is not mandatory)

If you want to serve files on a remote machine, that’s called proxying. You can use the proxy directive but the Caddyfile specifying that directive has to be local.

1 Like

I will look at the proxy and keep you in touch, thanks

Indeed the proxy directive was the correct solution.
I used
localhost:2020
proxy / 192.168.100.82:9000

Thanks Matt, good luck for the project, already so useful.
Best Regards

2 Likes

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