Sorry for the misunderstanding. I just follow your script to install Caddy, after that Manager Server can still be visited by port 8080, but cannot be visited through https or port 443. Therefore, I think the Caddy is not correctly configured.
So I don’t know whether there is additional step beyond the script you provided to enable SSL.
I am using a clean CentOS VPS to test the install of Manager, and I have enabled the port 443, as shown below:
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports: 443/tcp 8080/tcp 445/tcp
protocols:
masquerade: no
forward-ports:
sourceports:
icmp-blocks:
rich rules:
And systemctl status caddy shows:
caddy.service
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2017-08-13 05:00:03 EDT; 4h 15min ago
Main PID: 2181 (caddy)
CGroup: /system.slice/caddy.service
└─2181 /usr/local/bin/caddy -agree=true -conf=/usr/share/manager-server/ca…
Aug 13 05:00:03 UCS-IHAV6Q5B systemd[1]: Started caddy.service.
Aug 13 05:00:03 UCS-IHAV6Q5B systemd[1]: Starting caddy.service…
Aug 13 05:00:03 UCS-IHAV6Q5B caddy[2181]: Activating privacy features… done.
Aug 13 05:00:03 UCS-IHAV6Q5B caddy[2181]: https://
Aug 13 05:00:03 UCS-IHAV6Q5B caddy[2181]: http://
In this case, I can visit Manager via 8080, but at https, the browser said:
This site can’t provide a secure connection
xxxx.xxx.xxx sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
@lubos I have point the A record to my server, and visit it through 8080 with no problem. But it seems in the script you provided, there is no place to enter the domain, or provide the information of my domain/subdomain, so how can Caddy generate a SSL for me?
You don’t need to enter domain anywhere. Caddy will automatically request SSL certificate for domain name you are accessing when it’s for the first time.
So if you have a domain name something.anything.com when you go to https://something.anything.com, you get ERR_SSL_PROTOCOL_ERROR and when you go to http://something.anything.com:8080 you see Manager. Correct?
Try to access your server using different domain name, eg. www.10.0.0.1.xip.io or www.10.0.0.1.nip.io where you replace 10.0.0.1 with IP of your server.
You can add multiple rules into Caddy so it will redirect to different ports based on domain name. So you can have Caddy serving SSL for two or more different servers at the same time.
But this is out of scope for this forum, check documentation of Caddy at https://caddyserver.com/ to learn how to set it up. It’s quite common use case.