If i try to connect to FreshRSS or Qbittorent (two container in docker) with local ip : no problem.
If I try to connect by typing the address, it works but it’s extremely slow. Several minutes just to display the login page
4. Error messages and/or full log output:
No error message (unless i’m mistaken)
5. What I already tried:
I tried to run Caddy directly on my server (not through docker in a container) : same thing.
I tried to just reverse_proxy (without log) : same thing
thank you for taking the time to help me. i am a neophyte, please excuse my ignorance.
root@helios64:/etc/caddy# curl -v rss.mywebsite.me
* Expire in 0 ms for 6 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 0 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 1 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 2 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 3 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 3 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 3 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 3 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 5 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 5 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 4 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 5 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 5 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 8 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 7 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 7 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 8 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 7 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 7 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 8 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 9 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 9 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 8 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 10 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 10 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 16 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 13 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 13 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 16 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 13 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 13 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 16 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 50 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 50 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 16 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 50 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 50 ms for 1 (transfer 0xaaaad6054f10)
* Expire in 50 ms for 1 (transfer 0xaaaad6054f10)
* Trying 2001:xxx:yyy:zzz:xxx:yyy:zzz:3e55...
* TCP_NODELAY set
* Expire in 149948 ms for 3 (transfer 0xaaaad6054f10)
* Expire in 200 ms for 4 (transfer 0xaaaad6054f10)
* connect to 2001:xxx:yyy:zzz:xxx:yyy:zzz:3e55... port 80 failed: Connexion refusée
* Trying 80.xx.yy.zz...
* TCP_NODELAY set
* Expire in 149948 ms for 3 (transfer 0xaaaad6054f10)
* Connected to rss.mywebsite.me (80.xx.yy.zz) port 80 (#0)
> GET / HTTP/1.1
> Host: rss.mywebsite.me
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://rss.mywebsite.me/
< Server: Caddy
< Date: Sat, 06 Feb 2021 23:51:16 GMT
< Content-Length: 0
<
* Closing connection 0
and this is the resultat from my local network
* Trying 2001:xxx:yyy:zzz:xxx:yyy:zzz:3e55...
* TCP_NODELAY set
* connect to 2001:xxx:yyy:zzz:xxx:yyy:zzz:3e55 port 80 failed: Connexion refusée
* Trying 80.xx.yy.zz...
* TCP_NODELAY set
* Connected to rss.mywebsite.me (80.xx.yy.zz) port 80 (#0)
> GET / HTTP/1.1
> Host: rss.mywebsite.me
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://rss.mywebsite.me/
< Server: Caddy
< Date: Sat, 06 Feb 2021 23:54:01 GMT
< Content-Length: 0
<
* Closing connection 0
Then this is my log (again for the RSS subdomain) .
Ahhh I think you’re running into NAT hairpinning issues:
Basically, DNS for your domain is resolved to the WAN IP, then when a request goes out, it reaches your router, then because it likely doesn’t support NAT hairpinning, the connection gets dropped because it doesn’t know to route the request back internally.
Please read through this article to get an idea of how it works:
The solution is typically to also run a DNS server in your home network, to implement split DNS. Basically this means that your local DNS server will resolve your domain to the LAN IP address of your server, instead of the WAN IP address, but when outside of your home network, the domain will still resolve to the WAN IP.
Those are your access logs, not the Caddy logs. You can see those by running docker logs <name-of-the-caddy-container>.
Hey, thank you for your answer. Unfortunately, i dont understand two points
first, if i dont use docker, i dont have this kind of problem. Indeed if i intsall my app and caddy directly on my server : everything work.
then, i watched in my router and it support NAT hairpinning, and this option is activated.
Then, last thing very strange. When i try to access at my service from my laptop (and not my main computer) , everything work fine, nothing is slow.
(but still slow from my main computer)
I tried to launch my browser without any pluggin (on main computer) but nothing change.
End also, see my log : (i hope is the good one)
(very long so i used a pastebin to share you the file)
Hi @Mohammed90 , all my device are on the same network.
My router (192.168.1.1)
My main computer (wired to router) (192.168.1.2)
My laptop (wifi to router) (192.168.1.4)
and the server (wired to router) (192.168.1.5)
I used portainer to manage the container and there is the command for caddy :
‘caddy’ ‘run’ ‘–config’ ‘/etc/caddy/Caddyfile’ ‘–adapter’ ‘caddyfile’
Hi there.
I’m sorry for this mistake. But indeed my router cant manage this problem of hairpining.
I use pihole so i created with own dnsmasq to resolve this problem