Why is my nginx alias not working?

Posted by Rob on Server Fault See other posts from Server Fault or by Rob
Published on 2012-04-01T04:30:17Z Indexed on 2012/04/01 5:31 UTC
Read the original article Hit count: 173

Filed under:
|

I'm trying to set up an alias so when someone accesses /phpmyadmin/, nginx will pull it from /home/phpmyadmin/ rather than from the usual document root. However, everytime I pull up the URL, it gives me a 404 on all items not pulled through fastcgi. fastcgi seems to be working fine, whereas the rest is not. strace is telling me it's trying to pull everything else from the usual document root, yet I can't figure out why. Can anyone provide some insight?

Here is the relevant part of my config:

            location ~ ^/phpmyadmin/(.+\.php)$
            {
                    include fcgi.conf;
                    fastcgi_index index.php;
                    fastcgi_pass  unix:/tmp/php-cgi.sock;
                    fastcgi_param SCRIPT_FILENAME /home$fastcgi_script_name;
            }

            location /phpmyadmin
            {
                    alias /home/phpmyadmin/;
            }

© Server Fault or respective owner

Related posts about nginx

Related posts about alias