I cant make caddy 2 run on windows. Caddy 1 works fine

1. Caddy version (caddy version):

2.4.6

2. How I run Caddy:

open command prompt, go to c:\caddy2
type caddy2.exe run
press enter

a. System environment:

Windows 10

b. Command:

caddy2.exe run

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

domainname.com {
tls internal
encode zstd gzip
    root * C:\mywebsitefiles\htdocs\
file_server
log {
	output file caddy2domainname.com.txt
	format console
}
}

3. The problem I’m having:

I want to migrate from caddy 1 to caddy 2. I have delayed this migration for years because since caddy 2 beta, I have never been able to make it to run.

I got this error: Wrong argument count or unexpected line ending after ‘file_server’

4. Error messages and/or full log output:

5. What I already tried:

removing file_server makes caddy2 run, but I only get a blank white page.

6. Links to relevant resources:

Turns out i need to relace \ with /. now it works.

Do you mean in your root? It should work fine to use backslashes for the root on Windows.

Hmm yeah if backslashes don’t work then I want more information.

Edit: ohh it’s because of the trailing backslash, it is escaping the newline. I guess that’s expected. Remove the trailing backslash.

1 Like

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