phpmyadmin on apache behind https nginx

Gelonida gelonida at
Wed Jul 13 22:53:03 MSD 2011

Hi Jim,

Thanks for your answer,

On 7/13/2011 8:27 PM, Jim Ohlstein wrote:
> server {
>      ...
>      listen 80;
>      ...
>      location /phpmyadmin {
> 	rewrite ^ https://yourhost$request_uri? permanent;
>          ...
>      }
>      ...
> }
OK if I add above location rule in my http server,
then all phpmyadmin requests on my http server will be redirected to my
nginx https server.
I learnt something new. :-) ( Never used rewrite rules so far )

However my main problem is that
I enter https://hostname/phpmyadmin/index.php in my browser
and that phpmyadmin issues 301 with

the hostname is substituted correctly, but the protocol and the port 
number are the ones from my proxy_pass command.


Perhaps this problem disappears if I would use fastcgi.
However the current php version installed on my server wasn't compiled 
with the cgi option :-(

More information about the nginx mailing list