PHP头条
热点:

nginx配置phpmyadmin虚拟目录的问题


php

server {listen 80;
server_name ceshi3.com;
#charset koi8-r;
#access_log logs/host.access.log main;

Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;
location / {
root /www/html/ceshi3.com/htdocs;
index index.html index.php index.htm;
}

pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000#

location ~ .php$ {

root html;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www/html/ceshi3.com/htdocs$fastcgi_script_name;
include fastcgi_params;
}
location /phpmyadmin {
alias /usr/share/phpMyAdmin/;
index index.php;}
location ~ /phpmyadmin/.+.php$ {
if ($fastcgi_script_name ~ /phpmyadmin/(.+.php.*)$) {
set $valid_fastcgi_script_name $1;}
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin/$valid_fastcgi_script_name;
}
}但是这样配置之后phpmyadmin打不开,phpmyadmin不在网站根目录下,用的alias定义虚拟目录,如果我把 location ~ .php$这个删掉,phpmyadmin就可以打开了,但是这样网站首页如果是php的,那么打开首页就会变成下载php文件了,说明php解析不成功,这是怎么回事!
以上语法有错误吗,为什么有冲突呢?
http://kimsom.com 曾劲松博客

www.phpzy.comtrue/phpyy/4618.htmlTechArticlenginx配置phpmyadmin虚拟目录的问题 php server {listen 80; server_name ceshi3.com; #charset koi8-r; #access_log logs/host.access.log main; Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; lo...

相关文章

相关频道:

PHP之友评论

今天推荐