使用NGINX在VPS OVH(ubuntu 16.04)上登录PhpMyAdmin时出错

时间:2016-06-08 01:41:30

标签: php mysql ubuntu nginx phpmyadmin

我的(nginx / phpmyadmin)设置有一个奇怪的问题

ubuntu版本16.04 LTS服务器 nginx版本1.10.0 php版本7 MariaDB版本10.1.14-MariaDB-1~xenial - mariadb.org二进制发行版 phpmyadmin版本4.5.4.1deb2ubuntu1

我可以通过http://vpsXXX.vps.ovh.ca/phpmyadmin

访问phpmyadmin的登录页面

我输入用户名root和他的密码并登录

我收到404错误,因为登录过程从我的路径中删除“phpmyadmin”所以我得到这样的内容:http://vpsXXX.vps.ovh.ca/index.php?token= ...............

如果我手动插入... ovh.ca/phpmyadmin/index?token = ..... 它工作得很好......

那么如何解决这个路径问题

这是我的“默认”ngnix配置文件:/ etc / nginx / sites-available / default

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html index.php;

    server_name _;

    location /phpmyadmin {
        index index.php;
    }

    location / {
            # First attempt to serve request as file, then
            # as directory, then fall back to displaying a 404.
            try_files $uri $uri/ =404;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;

            # With php7.0-cgi alone:
            fastcgi_pass 127.0.0.1:9000;
            # With php7.0-fpm:
            #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
}

这是我的VHOSTS文件:/var/www/vhosts/skwad.me/conf/ngnix.conf

server {

    listen 80;
    listen [::]:80;

    root /var/www/vhosts/skwad.me/html/;
    index index.php index.html index.htm;

    server_name skwad.me www.skwad.me;

    access_log /var/www/vhosts/skwad.me/logs/access_log;
    error_log /var/www/vhosts/skwad.me/logs/error_log;

    location / 
    {
        try_files $uri $uri/ /index.php;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;

    location = /50x.html 
    {
        root /usr/share/nginx/html;
    }

# Pass the PHP scripts to FastCGI server #  
location ~ \.php$ 
{
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

提前感谢您的帮助!

0 个答案:

没有答案