Alias causing phpMyAdmin login endless loop

acjohnson nginx-forum at
Tue Mar 8 04:37:08 MSK 2011

This problem is not limited to just phpMyAdmin. I am trying to do the
same thing using nginx 0.7.65 (ubuntu 10.04 stable nginx package) in a
vhost that uses / for a RoR application via mongrel_cluster and then I
want multiple php aliases to reside under / like /opensis and
/phpmyadmin, and both programs experience the same login endless loop

In this case I cannot simply use a symlink because I want to run a php
application in an alias folder inside the RoR application.

Here are my current location blocks including the mongrel_cluster
location which is the first one:

        location / {
           root /var/www/sis/public;
           proxy_set_header  X-Real-IP        $remote_addr;
           proxy_set_header  X-Forwarded-For 
           proxy_set_header  Host             $http_host;
           proxy_redirect    off;
           proxy_read_timeout 300;
           proxy_pass http://mongrel/;

        location ~ ^/phpmyadmin/(.*\.php)$ {
           alias /var/www/phpmyadmin/$1;
           fastcgi_param HTTPS on;
           fastcgi_param SCRIPT_FILENAME
           include fastcgi_params;

        location = /phpmyadmin {
           rewrite ^ $scheme://$host$uri/ permanent;

        location /phpmyadmin/ {
           index index.php;
           alias /var/www/phpmyadmin/;

The above configuration gets me closer than anything else I have found
so far. PHP is served and the default document defaults to index.php for
the alias but for some reason it is still not the right configuration
because of the login loop issue.

Hopefully one of the devs can respond to this with a working
configuration. I think part of the problem is that everyone is using
different versions of nginx and bug fixes and code changes have modified
how aliases function in nginx.

Who knows, maybe my whole problem is an outdated version of nginx...

Posted at Nginx Forum:,166700,181121#msg-181121

More information about the nginx mailing list