1.添加配置文件
/etc/nginx/sites-available/ 下新建文件 phpmyadmin
文件内容
server {
listen 80;
listen [::]:80;
server_name 要设置的域名;
root /var/www/html/phpmyadmin;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}
2.建立软连接
ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/
时间: 2024-11-04 13:08:24