Apache proxy running in docker container can't access localhost

What am I trying to achieve -> I’d like to use my locally run application through docker container.

I created an apache proxy running in docker container.
proxy (docker container) -> localhost application (on physical host)

  • How to choose to which network doing port mapping
  • How to make docker container to be accessed only in intranet
  • How do I tag a local docker image with ansible docker_image module?
  • Docker container that depends on file in other container
  • boot2docker resulting in “Cannot connect to the Docker daemon. Is 'docker -d' running on this host?”
  • how to permanently set environment variable for boot2docker
  • When I direct my browser to docker_ip:8001, the apache instance is running, but it can’t proxy the host localhost.

    Configuration is as follows:

    <Location /test/auth>
        SSLRequireSSL
        SSLVerifyClient optional
        SSLVerifyDepth 3
        SSLOptions +ExportCertData +StdEnvVars
    
        RewriteEngine on
        RewriteCond %{SSL:SSL_CLIENT_VERIFY} !^SUCCESS$
        RewriteRule .* /test/fail [L]
    </Location>
    
    RequestHeader set HTTPS "%{HTTPS}s" env=HTTPS
    ...
    
    
    ProxyPass               /test   http://host:8080/test retry=0
    ProxyPassReverse        /test       http://host:8080/test
    

    I have an application running on wildfly @ http://localhost:8080/test (host machine)

    The expected behaviour is that I go to docker_ip:8001/test and I can use the application running at http://localhost:8080/test.

    This does not work for me and nor the other similar questions. eth0 ip is pingable, but when I do wget I get connection refused.

    So I tried running

    docker run --add-host=host:192.168.xxx.xxx -p 8001:443 -it docker-test bash
    

    now pinging and wget against host worked well and it received a response from an apache I’m running on host. How can I replace 192.168.xxx.xxx with localhost?

    *Note: using win7, but this should not really matter?

  • How to link two docker containers which are spawned with two different docker-compose.yml
  • automate couchbase configuration in docker
  • docker-compose build error ubuntu mango
  • How to backup MongoDB in a setup with multiple Docker containers?
  • How to check if dotnet restore was ok in ps1?
  • mount external volumes in docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.