Right now I have this config:
location ~ ^/phpmyadmin/(.*)$
{
alias /home/phpmyadmin/$1;
}
However, if I visit www.mysite.com/phpmyadmin
(note the lack of trailing slash), it won't find what I'm looking for a 404. I assume because I don't include the trailing slash. How can I fix this?
Best Answer
It might be in the regular expression that you're using --
The above will match /phpmyadmin/, /phpmyadmin/anything/else/here, but it won't match /phpmyadmin because the regular expression includes the trailing slash.
You probably want something like this:
The question mark is a regular expression quantifier and should tell nginx to match zero or one of the previous character (the slash).