Phpmyadmin & Caddy


(Tatch Capital) #1

Hello guys !
I have a issue while trying to TLS phpmyadmin with caddy.

I tried a few stuff but only this I can get working is to

www.MYSITE.COM
proxy / 127.0.0.1:8080/phpmyadmin and it works BUT anything else that the login page is not accessible.

(*/phpmyadmin/index.php…) for instance.

Not sure what I’m missing, thanks in advance for any help,

With best regards,

Cédric


(Matthew Fay) #2

Hi @Tatch_Capital,

Can you clarify what “not accessible” means?

e.g. what action did you take, what result did you expect, and what happened instead, exactly?


(Tatch Capital) #3

well once I entered credentials, I’m redirected to http://127.0.0.1:8080/phpmyadmin/index.php?lang=
And those pages are not reachable.

Somehow pages behind /phpmyadmin or not available.

Thanks for your reply !


(Matthew Fay) #4

What, specifically, is causing you not to be able to access them?

Does your browser time out? Does it receive an error from Caddy?


(Kurtis Rader) #5

Presumably your original request URL was not on 127.0.0.1:8080. Have you tried specifying a transparent proxy:

proxy / 127.0.0.1:8080/phpmyadmin {
   transparent
}

FWIW, I know it is often hard to know what relevant details to provide when asking for help. But in this case telling us what the original URL was, whether you were making the request from the system running the system running the Caddy web server, and the nature of the failure (e.g., a 404 not found error) would have helped. More information, within reason, is usually better than too little.


(Kurtis Rader) #6

Also, when debugging these types of problems it is usually better to use a CLI tool like curl which can be told to report the HTTP headers, any redirects, etc. rather than a normal browser which will obscure that information.


(Tatch Capital) #7

well here is my caddyfile:

db.website.com {
proxy / myip:8080/phpmyadmin/ {
transparent
}
}

the db.website.com works fine in HTTPS and all but once I enter my credentials; I get redirected to https://db.mywebsite.com:80/phpmyadmin/index.php?lang=en&collation_connection=

from which I get a connection time out at some point; curl on the redirection link with the token give:

curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received.

Not sure what I did wrong


(Matthew Fay) #8

It looks like you’re being redirected to HTTPS on port 80. The “unexpected TLS packet” is undoubtedly a non-TLS, unencrypted, standard HTTP packet because Caddy’s HTTP-only listener will be on port 80.

I’m not sure why on earth the app would successfully issue a redirect to the HTTPS scheme at the proxied hostname… But instead of using the client request port (443) or the proxy request port (8080) - either of which I’d understand - explicitly redirecting to port 80.

Does the app have a configurable setting to inform it which port it should expect to be served on?


(Matthew Fay) #9

Just did some quick research. Looks like this issue is frequently reported on the app’s bug tracker.

https://sourceforge.net/p/phpmyadmin/bugs/3538/
https://sourceforge.net/p/phpmyadmin/bugs/3704/
https://sourceforge.net/p/phpmyadmin/bugs/4120/
https://sourceforge.net/p/phpmyadmin/bugs/4621/