Is is possible that I launch it as http://example.com/phpmyadmin/ ?
PMA_ABSOLUTE_URI seemed not work.
Do you use latest version, PMA_ABSOLUTE_URI sould be the way to do it, but it's not supported on anything older than 4.6.5.
Thanks @nijel I'll check the version tomorrow. I thought I excuted docker pull phpmyadmin/phpmyadmin:latest today. I was wondering that my container ran with php command not nginx and supervisor. I might take some mistakes...
docker pull phpmyadmin/phpmyadmin:latest
That sounds correcty, but if there is no supervisor, it's clearly some older version. Maybe I've made something wrong in the docker hub tags setup....
@nijel I feel that's understandable for me. I'd had old container at the moment so I did docker pull and docker rm -f container then docker-compose up. But there's no supervisor inside the container. I'd like to know your recommended tag, thanks.
docker rm -f container
Hi @nijel, I was wrong that I specified an old image in docker-compose.yml. I'm sorry to bother you. Now I launched the latest container Version 220.127.116.11. But PMA_ABSOLUTE_URI seemed not to work for subdirectory. I'm wondering where your subdirectory code is. My /etc/nginx.conf is completely same as its original, there's no alias. (I tried to add those lines but couldn't make it work... I've got to learn nginx first).
Could you tell me how you tried a web server to have an alias?
The PMA_ABSOLUTE_URI doesn't change the path where phpMyAdmin is served from the container (it's always on /), it's there for possibility to run it behind reverse proxy which will change the location.
It's there for handing following setups:
(reverse proxy) <-> (phpMyAdmin docker)
Here phpMyAdmin would think it's running on http://18.104.22.168/, while the user sees it at https://host/some/path/. In such case setting PMA_ABSOLUTE_URI=https://host/some/path/ is needed.
I used phpmyadmin behind haproxy so tried to setup haproxy as a ProxyPass and works!
Here's my haproxy settings for subdirectoried phpmyadmin .
### NETWORK restriction
acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
acl phpmyadmin path_dir /phpmyadmin
use_backend phpmyadmin if phpmyadmin LOCALNET
# ProxyPass /phpmyadmin/ http://172.30.21.21/
reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2
server localhost 172.30.21.21:80 # <- phpmyadmin container IP
Here's docker-compose.yml for phpmyadmin.
ipv4_address: 172.30.21.21 # <- Specified container IP for haproxy
Now they're working perfectly. Thank you very much. Would my settings be added to your document perhaps?
Adding that to the docs could be useful, can you please document your setup for our docs? It's here: https://github.com/phpmyadmin/phpmyadmin/blob/master/doc/setup.rst#installing-using-docker
Add Docker sample for haproxy and subpath
Signed-off-by: Michal Čihař <firstname.lastname@example.org>