我正在尝试将phpMyAdmin移动到我的Nginx配置中的单独位置块。
当我使用以下配置输入服务器的IP地址时,它正在运行并设置为运行:
server {
#default_server
listen 80 default_server;
listen [::]:80 default_server;
root /usr/share/phpmyadmin;
index index.php;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
但是我需要将其更改为以下内容:
server {
location / {
... settings for my website...
}
location /phpmyadmin {
... adapted config as shown above...
}
}
我已经尝试过了,但是不起作用:
server {
location / {
... settings for my website...
}
location /phpmyadmin {
alias /usr/share/phpmyadmin;
index index.php;
try_files $uri $uri/ =404;
location ~ /manage/\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /manage/\.ht {
deny all;
}
}
}
我得到的最佳方案是浏览器下载index.php而不是渲染php。
在进入www.url.com/phpmyadmin时,如何更改它以显示phpMyAdmin管理站点?