BB behind SSL Reverse Proxy

  • Hi @all,


    I'm trying to install the App behind a Apache2 Proxy into a Docker Container. But it doesn't work for me with my current config.



    My VHost-Config:


    And my docker-compose.yml:


  • Hi


    what exactly is the issue? While I have Docker at hand I don't have an Apache 2 Reverse Proxy at hand and I might be able to pinpoint the issue if you explain what does not work.

  • Hi,

    the request gets caught in a loop:

  • I swiched the BE Server back to HTTP instead of HTTPS at the moment. With curl I get the Index-Page:


    and

    That's really weird: https://localhost:8905

  • Hi

    That's really weird: https://localhost:8905

    this indicates an issue passing along the original Host header to the Apache in Docker. I am not proficient in configuring Apache, but you might want to check whether RequestHeader set Host "my.domain" (from the configuration you posted above) is the correct way to do this.

  • Can't I set the host manually in some Config?
    Where does the BB get localhost:8905from?


    When I look in the log of the Container it seems ok:

    Code
    [php-fpm:access] 127.0.0.1 - 27/Jul/2017:12:39:08 +0000 "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php" 200 /app/acp/index.php 82.866 4096 48.27%
    circle | circle.ting.systems:80 10.0.2.2 - - [27/Jul/2017:12:39:08 +0000] "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php HTTP/1.1" 200 8946 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
    circle | [httpd:access] localhost:80 10.0.2.2 - - [27/Jul/2017:12:39:08 +0000] "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php HTTP/1.1" 200 bytesIn:525 bytesOut:8946 reqTime:0
    circle | [php-fpm:access] 127.0.0.1 - 27/Jul/2017:12:39:51 +0000 "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php" 200 /app/acp/index.php 109.382 2048 0.00%
    circle | circle.ting.systems:80 10.0.2.2 - - [27/Jul/2017:12:39:51 +0000] "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php HTTP/1.1" 200 8946 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
    circle | [httpd:access] localhost:80 10.0.2.2 - - [27/Jul/2017:12:39:51 +0000] "GET /acp/index.php?login/&url=http%3A%2F%2Flocalhost%3A8905%2Facp%2Findex.php HTTP/1.1" 200 bytesIn:525 bytesOut:8946 reqTime:0

    //edit: Switched to HTTP for testing

  • Hi

    Where does the BB get localhost:8905from?

    it's taken from the HTTP_HOST value as provided by the Webserver (in your case the Apache in Docker). You might want to add a file with a <?php phpinfo(); inside the Docker container and provide me a link to it (you can send a conversation). I'll have a look at the values and may be able to suggest a fix.

  • Hi


    as expected the value inside $_SERVER['HTTP_HOST'] is incorrect, instead it is provided inside $_SERVER['HTTP_X_FORWARDED_HOST']. Unfortunately I cannot help with that, as I know next to nothing about Apache and how one would go on changing the configuration for those Dockerfiles (in fact they look uncessarily complex to me, I prefer the stock php:apache / nginx + php:fpm Dockerfiles).

  • The Docker-Image is quite awesome, as it support all this configuration options but you aren't forced to use them..

    Can I set the $_SERVER vars somewhere manually?