No automatic HTTPS

1. The problem I’m having:

Im using shared hosting that provides a caddy server. On the caddy server im using NamelessMC CMS. Everything works fine at this point. When I install a custom template on Nameless, it uses their API to create widgets. These widgets are not working, Which Ive been told is due to something with proxies.
So after much research, Im led to believe that its because of the port and http/https. I look in my console and see the error below.

From what im reading Im suppose to put my domain in the caddy file for it to auto resolve this issue, however I THINK I have tried this with no luck, although my file is quite confusing. Please let me know if you have any advice.

2. Error messages and/or full log output:

http.auto_https server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server      {"server_name": "srv0", "http_port": 25566}

3. Caddy version:

I’ve ran both ‘caddy version’ and ‘docker-compose exec caddy caddy version’ and neither of those commands in my console return a caddy version. I can say that the readme file says V2 although I know that’s not acceptable.

4. How I installed and ran Caddy:

My shared host ‘bloom.host’ has provided the caddy installation for me.
My domain is ‘saltwaterscourge.com

a. System environment:

My console says its pulling from docker container pterodactyl from
Package pterodactyl-caddy · GitHub

b. Command:

My /start.sh file contains

#!/bin/ash

echo "Starting PHP-FPM..."
PHP_FPM=$(find /usr/sbin -name "php-fpm*" -type f | tail -n 1)
$PHP_FPM --fpm-config /home/container/php-fpm/php-fpm.conf -c /home/container/php-fpm/ --daemonize

echo "Starting Caddy..."
./caddy-server run --watch --config ./caddy/Caddyfile

c. Service/unit/compose file:

I dont believe I have access to this

d. My complete Caddy config:

{
    http_port 25566
    https_port 25566
    admin off
}
 
(namelessmc) {
    @nameless-blocked path_regexp \.(tpl|cache)$
    route @nameless-blocked {
        respond "Page forbidden." 403
    }
    try_files {path} /index.php?route={path}&{query}
}
 
# You can replace :<port> with a domain such as "example.com", to where only requests from that host will be routed. 
:25566 {
    root * /home/container/public
    file_server
    encode zstd gzip
 
    php_fastcgi unix//tmp/php-fpm.sock
 
    import namelessmc
}

5. Links to relevant resources:

This is the API link, which is working. Though when I click the login/register its returning as http not https
https://saltwaterscourge.com/index.php?route=/api/v2/*

Your HTTP and HTTPS port should never be the same. This is the problem.

Also why aren’t you using the default ports 80 and 443?

Why are you turning off admin? This means you won’t be able to reload Caddy gracefully. Leave it on unless you have a specific reason to turn it off.

You need a domain name for Caddy to manage TLS issuance for it.

Thank you for your reply!
Are those ports the problem? I’ve attempted changing them but I my host automatically changes it back to 25566 everytime i try to start the server again.

I can not change admin off as it is a shared host, im guessing that messes with their integrity.

And I have changed :25566 { to saltwaterscourge.com, Neither of them work for the API, nor does it resolve the error I shared above, So i just changed it back to default. (25566, is what the host provided). Though if my ports are the problem and theyre willing to change them, i will change this to my url

Should I contact my host about the ports?

What?

Is something manipulating your Caddyfile automatically?

I can’t help you with that if that’s the case, you’ll need to get help from whoever authored whatever is doing that.

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