1

I'm trying to migrate a site over to Docker. I've followed a number of guides and I'm almost there.

I'm using the php:7.2.7-fpm-alpine3.7 image to separate PHP from Apache.

My site is in the local folder /var/www/html/app with the Apache Docker container.

My Apache conf file looks like this:

ServerName localhost

LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so

<VirtualHost *:80>
    # Proxy .php requests to port 9000 of the php-fpm container
    ProxyPassMatch ^/(.*\.(php|inc)(/.*)?)$ fcgi://php:9000/var/www/html/$1
    DocumentRoot /var/www/html/
    <Directory /var/www/html/>
        DirectoryIndex index.php
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>

    # Send apache logs to stdout and stderr
    CustomLog /proc/self/fd/1 common
    ErrorLog /proc/self/fd/2
</VirtualHost>

My issue is that Apache appears to be rewriting/editing the URLs at some point and I can't figure out why, for example if I try to access a file at http://localhost/app/htdocs/install.php I will see logs for GET requests to /app/dist/* (the location should be /app/htdocs/dist/* and thus I get a 404). Install should lead to http://localhost/app/htdocs/admin/install_db.php but instead the browser goes to http://localhost/app/admin/install_db.php.

I believe this is a rewrite issue because the same site code on the host machine with a standard *AMP stack works without issue.

Many thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.