How can i listen localhost 2 ports?

when i add 2 ports config

:8888 {
    root * /home/demo
    root * /home/dist
}

:7000 {
    file_server
    root * /home/test
}

error:

run: adapting config using caddyfile: automation policy from site block is also default/catch-all policy  
because of key without hostname, and the two are in conflict:  
[]certmagic.Issuer{(*caddytls.ACMEIssuer)(0xc000102780)} != []certmagic.Issuer(nil)

when i alter config:

:8888 {
    root * /home/demo
    root * /home/dist
}

127.0.0.1:7000 {
    file_server
    root * /home/test
}

error:

WARN	tls	stapling OCSP	{"error": "no OCSP stapling for [127.0.0.1]: no OCSP server specified in certificate"}

how can i listen localhost 2 ports?

Please fill out the help thread template. Using v2.3.0, I can’t reproduce that problem.

You didn’t specify which version you’re using, how you installed Caddy, etc. Those are important bits of information, and it’s why we require users to fill out the help thread template.

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