Golang ReverseProxy到不同的ip不起作用

i am trying to make my own ReverseProxy in go. So it should connect my Apache Webserver with another Go Webserver.

So when I request "/" the proxy should send the request to apache and serve the website of the apache server. When I request "/gotest" it should send the request to the go webserver

But the ReverseProxy and the Apache Webserver should run on different ip-adresses.But all should run with SSL. Example: ReverseProxy runs on : 192.168.2.1 Apache Server runs on: 192.168.2.5

If both run on same ip but different ports, it works verry well. But when I run Apache on different ip, the reverseproxy get one request and website is shown. But then my reverseproxy doesn't get new reqeusts.

Have anyone an idea what I am doing wrong?

type Proxy struct {
    listener    net.Listener
    TlsConfig   *tls.Config //config of the TLS-Connection
    mux         *http.ServeMux
    goHandler   http.Handler //Handler to send Requests to GO-Webserver
    mainHandler http.Handler //Handler to send Requests to the main webserver
    Host        string       //Host of the Reverse-Proxy
    Port        int          //Port of the Reverse-Proxy
}


//New returns a new ReverseProxy with the configuration of the given toml file
func New(configPath string) *Proxy {

    if err := common.READCONFIG(configPath); err != nil {
        log.Fatalf(err.Error())
    }

    p := &Proxy{
        mux:  http.NewServeMux(),
        Host: common.CONFIG.ReverseProxy.Host,
        Port: common.CONFIG.ReverseProxy.Port,
    }

    p.goHandler = &httputil.ReverseProxy{
        Director:      p.directorGo,
        FlushInterval: 1 * time.Millisecond,
    }

    p.mainHandler = &httputil.ReverseProxy{
        Director:      p.directorMain,
        FlushInterval: 1 * time.Millisecond,
    }

    pathCert := common.CONFIG.PathCert
    pathKey := common.CONFIG.PathPrivateKey
    //Loads the ssl-cert and private-keyn
    cert, err := tls.LoadX509KeyPair(pathCert, pathKey)
    if err != nil {
        common.Log.Critical("ReverseProxy: load SSL-Keys: %s", err)
    }
    //Change Transport to avoid ssl-certificate error:"certificate signed by unknown authority"
    http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}

    p.TlsConfig = &tls.Config{Certificates: []tls.Certificate{cert}}

    listener, err := net.Listen("tcp",
        net.JoinHostPort(p.Host, strconv.Itoa(p.Port)))

    if err != nil {
        common.Log.Critical("ReverseProxy: can't listen: %s", err)
        os.Exit(1)
    }

    p.listener = tls.NewListener(listener, p.TlsConfig)

    //Each request should be handled by the proxy
    p.mux.Handle("/", p)

    return p
}

//isGoRequest checks if the given Request is for the go-webserver
func (p *Proxy) getProxyAdress() string {
    return fmt.Sprintf("%s:%d", p.Host, p.Port)
}

//isGoRequest checks if the given Request is for the go-webserver
func (p *Proxy) isGoRequest(req *http.Request) bool {
    if strings.Contains(req.URL.Path, common.CONFIG.ReverseProxy.GoUrlPath) {
        return true
    } else {
        return false
    }
}

//directorMain modifies the request to a new request for the main-webserver
func (p *Proxy) directorMain(req *http.Request) {
    mainServer := fmt.Sprintf("%s:%d", common.CONFIG.ReverseProxy.HostMain, common.CONFIG.ReverseProxy.PortMain)
    req.URL.Scheme = "https"
    req.URL.Host = mainServer
}

//directorGo modifies the request to a new request for the go-webserver
func (p *Proxy) directorGo(req *http.Request) {
    goServer := fmt.Sprintf("%s:%d", common.CONFIG.Pointstreamer.Host, common.CONFIG.Pointstreamer.Port)
    req.URL.Scheme = "https"
    req.URL.Host = goServer
}

// ServeHTTP implements the http.Handler interface.
func (p *Proxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
    fmt.Println(req.URL.Path)
    if p.isGoRequest(req) {
        p.goHandler.ServeHTTP(rw, req)
        return
    }
    p.mainHandler.ServeHTTP(rw, req)
}

func main() {
    var configPath = flag.String("conf", "../../configDevel.toml", "Path to the toml config file.")

    flag.Parse()
    proxy := New(*configPath)

    httpsServer := &http.Server{
        Handler:   proxy.mux,
        TLSConfig: proxy.TlsConfig,
    }
    common.Log.Info("Server listens on", proxy.getProxyAdress(), "Main Redirect", common.CONFIG.ReverseProxy.HostMain)

    if err := httpsServer.Serve(proxy.listener); err != nil {
        common.Log.Critical("ReverseProxy Server Error:", err)
        os.Exit(1)
    }

}