I am having problems reaching an HTTPS site hosted by local host (the docker host, where docker is running) from within the container. This is the error I get:
$ docker exec -it sonarr curl https://apache.site.somethingcurl: (35) OpenSSL/3.1.4: error:0A00010B:SSL routines::wrong version number
I enabled debug logs for the Apache SSL module on the local host, when I try to run curl from inside the container I get this:
[core:debug] [pid 31563] protocol.c(1388): [client 172.17.0.2:59454] AH00566: request failed: malformed request line
The Docker container is running in bridge mode. It knows who apache.site.something is via extra_host:
extra_hosts: - apache.site.something:host-gateway
The name resolution works as expected, infact when i try HTTP it can reach the Apache reverse proxy and the request is correctly logged to access.log.
After a bit of work I realized this: since apache.site.something is public and reachable from Internet, I have an internal DNS server on the local host to translate apache.site.something into private IP for LAN client, so there is no NAT hairpin within LAN when trying to reach my homeserver.When there is no extra_hosts entry in the docker-compose file, the name is translated to the public IP of my router and communication with SSL works.But I don't like that, I don't want the container to reach my internal Apache site through the public IP of the router.
Please let me know if more information is needed
I want to reach my Apache reverse proxy on the local host inside the docker container, built with docker-compose and running in bridge mode.