2011年2月18日星期五

Re: Alias causing phpMyAdmin login endless loop

"location ~ ^/phpmyadmin/(.*\.php)$" -->> How about all the other
phpMyAdmin files that are not .php files?

This works for me (Replace 'proxy' with 'fastcgi').

[code]
server {
location ~ .+\.php$ {
# Return '400 Bad Request' for dodgy urls;
location ~ \..*/.*\.php$ {
return 400;
}
# Send others to proxy;
error_page 402 = @proxy;
return 402;
}
location ~ ^/phpMyAdmin/(.*)$ {
alias /server/path/to/phpMyAdmin/;

# Require authentication
auth_basic "Area-Name";
auth_basic_user_file htpasswd-file;

# Serve static files directly and pass dynamic requests to proxy;
try_files $uri $uri/ @proxy;
}
location @proxy {
proxy_pass http://127.0.0.1:xyz;
...
}
}
[/code]

The setup means all phpMyAdmin request go through the phpMyAdmin
location first.

As said, swap fastcgi for proxy and should be good to go.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,166700,176509#msg-176509


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论