Getting status 308 despite trying everything

1. Caddy version:

v2.6.3 h1:QRVBNIqfpqZ1eJacY44I6eUC1OcxQ8D04EKImzpj7S8=

2. How I installed, and run Caddy:

I installed caddy for Ubuntu as per official documentation, running it through systemd

a. System environment:

Ubuntu 22.04.1 LTS, systemd

b. Command:

sudo systemctl start caddy

c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateDevices=yes
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

d. My complete Caddy config:

{
    acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}

mobileapp.rocketbot.pro  {
        # Set this path to your site's directory.
        root * /usr/share/caddy

        # Enable the static file server.
        file_server

        # Another common task is to set up a reverse proxy:
        # reverse_proxy localhost:8080
         handle /api/* {
            reverse_proxy 127.0.0.1:7100
        }
        # Or serve a PHP site through php-fpm:
        # php_fastcgi localhost:9000
}

3. The problem I’m having:

Basically all I want is to point out mobileapp.rocketbot.pro/api/ to backend, above specified caddyfile is result of what I find on the internet, I started with caddy command:

sudo caddy reverse-proxy --from mobileapp.rocketbot.pro --to localhost:7100

All of attempts ended up same, I was getting error 308, permanently redirected

BUT the site on port 80 works, for some reason

4. Error messages and/or full log output:

Paste logs/commands/output here.
There isn't anything there

5. What I already tried:

Well I’ve tried a lot of edits of the caddyfile, I’ve tried ever Nginx where I was getting err 301, I tried contact client, if they don’t have something bad done in cloudflare console and obviously a lot of searching what is happening. Maybe I am ignorant, but couldn’t find anything useful, which would work

6. Links to relevant resources:

I’m sure that’s not true. Did you follow the instructions to find your logs from journalctl? Did you enable the debug global option?

Are you using http:// or https://? Your site is being served over HTTPS. I can load https://mobileapp.rocketbot.pro just fine.

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