Home > Mobile >  Integrating phpmyadmin in Flask
Integrating phpmyadmin in Flask

Time:04-17

I am writing a Website for a Friend of mine for a project we both are working on. In this project we are using phpmyadmin for multiple applications and the Website should use it as well.

Currently we can access it with their own url with e.g friends-url/phpmyadmin but the Website is supposed to run on the same url and port, so we ran into the problem that we can't have both running at the same time and the only fix we found would be to rewrite the enitre website in php which would be quite unfortunate.

Is there any way that i could integrate phpmyadmin in my flask website so we can continue to use it as we are currently doing with flask-website/phpmyadmin?

CodePudding user response:

Ideally you should have both your Flask application and phpMyAdmin behind a reverse proxy. You can tell the reverse proxy to forward all requests to your application except for those having an URL starting with /phpmyadmin/. See below for an example of a Caddy configuration that works like that.

myflaskapplication.example.com localhost {

    route /phpmyadmin/* {
        reverse_proxy localhost:3000
    }

    route {
        reverse_proxy localhost:5000
    }
}
  • Related