How can CADdy enable HTTPS in Windows?

1. Caddy version (caddy version):

v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=

2. How I run Caddy:

I tried the site many times, but it didn’t work; For example, the IP address of the local nodeJS service is localhost:3001 and my domain name is abc.cn

Can you give me a code reference that can open HTTPS?

use Caddyfile ?

a. System environment:

Windows

b. Command:

Paste command here.

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:

Paste config here, replacing this text.
Use `caddy fmt` to make it readable.
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
Make sure the backticks stay on their own lines.

3. The problem I’m having:

4. Error messages and/or full log output:

ERR_CONNECTION_ABORTED

5. What I already tried:

caddy.exe reverse-proxy --from abc. cn --to localhost:3001
caddy.exe reverse-proxy --to 127.0.0.1:3001

Caddyfile

abc. cn
respond “Hello, privacy!”

localhost
reverse_proxy 127.0.0.1:3001

abc. cn
reverse_proxy 127.0.0.1:3001

http:// abc. cn:80 https:// abc .cn:443 {
reverse_proxy 127.0.0.1:3001
}

localhost
reverse_proxy 127.0.0.1:3001

caddy.exe run

6. Links to relevant resources:

Please completely fill out the help topic template.

What version exactly? Run caddy.exe version to find out.

What did you try? That’s one of the questions asked in the template.

Did you read the docs?

1 Like

Having read the full HTTPS and[quote=“francislavoie, post:2, topic:15625, full:true”]
Please completely fill out the help topic template.

What version exactly? Run caddy.exe version to find out.

What did you try? That’s one of the questions asked in the template.

Did you read the docs?

[/quote]

reverse proxy documentation, there is still no solution

Please read the docs for Caddyfile syntax:

  • The open curly brace { must be at the end of its line.
  • The close curly brace } must be on its own line.

When there is only one site block, the curly braces (and indentation) are optional. This is for convenience to quickly define a single site, for example, this:

These are the multiple commands I tried
It’s not a single file

It’s not the same file

Try multiple commands in sequence

The domain name error is intentional, because the question here does not allow multiple inclusion

Syntax error, should not be able to run when he succeeded

My domain name is abc.cn
Server: localhost:3001

Could you please directly give me a successful Caddyfile attempt?

I just want the browser to type https://abc.cn to access it

abc.cn {
    # only one of these will happen
    respond “Hello, privacy!”
    reverse_proxy 127.0.0.1:3001
}

localhost {
    reverse_proxy 127.0.0.1:3001
}

Note that sometimes Chinese servers have difficulty accessing American CAs.

Still inaccessible

Access to https://localhost is local only

Thank you for your answer, it appears that it will not run under Windows

Many people use Caddy successfully on Windows.

1 Like

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