[SOLVED ]Redirect without redirect configuration

Hi all,

I run caddy now for 2 weeks, very nice. Now I wanted to add another
domain without TLS to create certificates for my turn server (I have some
shell scripts wich use lego and http challenge). After adding the site
I got redirects to an port, but I did not configure any redirects. See
the filled form below.

Any ideas are welcome.

1. My Caddy version (caddy version): v2.0.0-beta.15 h1:Td1esMk7bebftnoBuT3gOqUGxew5HqdIKw3s36S8tNw=

2. How I run Caddy:

a. System environment:

Linux Debian System

d. My complete Caddyfile or JSON config:

(clacks) {
  header X-Clacks-Overhead "GNU Terry Pratchett"
}

meersau.de, www.meersau.de {
  import clacks
  file_server {
    root /srv/www/meersau.de/www-data
  }
}

giegi.de, www.giegi.de {

  reverse_proxy /bilder/* http://localhost:4200

  file_server {
    root /srv/www/giegi.de/www-data
  }

  log {
    output file /var/log/caddy/giegi.de.log
  }
}

riot.meersau.de {
  #reverse_proxy /_matrix http://localhost:8008 
  reverse_proxy /* http://localhost:8008 
  log {
    output file /var/log/caddy/riot.log
  }
}

riot.meersau.de:8448 {
 reverse_proxy / http://localhost:8008 
  log {
    output file /var/log/caddy/riot.log
  }
}

turn.meersau.de {
  file_server {
  root /srv/www/default/
  }
  tls alex@meersau.de
}

3. The problem Iā€™m having:

If I connect to turn.meersau.de it will be redirected to turn.meersau.de:8448

$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
Host: turn.meersau.de

HTTP/1.1 308 Permanent Redirect
Connection: close
Location: https://turn.meersau.de:8448/
Server: Caddy
Date: Tue, 17 Mar 2020 07:30:00 GMT
Content-Length: 0

5. What I already tried:

I tried to place the block to another position in the caddy file

As a first step could you try beta 17? It might be that your issue has already been fixed.

After update caddy did not start with the config option tls alex@meersau.de .

The redirect now redirects to https://turn.meersau.de which is correct.

But it is not what I want :sweat_smile:

The goal is to have a Webserver which I can use for ACME challenge so that
caddy will not do the ACME challenge.

Regards,
Alex

The solution is:

http://turn.meersau.de {
  file_server {
  root /srv/www/default/
  }
}

Just define the Host as http://.

Thanks,
Alex

1 Like

Thanks for following up! Glad you figured it out!

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