phpMyAdmin behind HAProxy
-
I have phpMyAdmin running on a backend server on port 80 at /phpmyadmin. I want my backend to append the /phpmyadmin to any requests.
This is what my backend setup looks like:
If I go to https://phpmyadin.somedomain.org it correctly routes me to my backend and displays the logon page.
However, when I attempt to login, I get a cookie error and the path in the browser address is not updated to include the /phpmyadmin. I suspect that I am missing something here with respect to the client maybe rewriteing the path when I click the logon button?
If I manually add /phpmyadmin to the path above (ie: /phpmyadmin/index.php) I am succesfully logged in
As you can see, from the rules I have a similar configuration for pgadmin and icinga which work without issue.
-
I was able to solve the issue by shifting the redirect rules for phpmyadmin to the frontend instead of trying to path it out on the backend. This resolved the issue for me.
Front End
Since the pathing now happens in the front end, I was able to clean up the backend and it's just a simple passthrough in the case of phpmyadmin.
Hopefully, this helps someone else out too. There's probably a more elegant way to solve this, but it did the trick for me.