我从apache2
服务器上的Nginx
迁移到Lubuntu
。
我按如下所示配置了phpmyadmin
网站,并且可以从localhost:88
成功导航到该网站。
命令:sudo nano etc/nginx/sites-available/phpmyadmin
server {
server_name _;
listen 88;
listen [::]:88;
listen 443 ssl http2;
listen [::]:443 ssl http2;
allow all;
# access_log logs/host.access.log;
# error_log logs/host.error.log;
root /usr/share/phpmyadmin;
index index.php;
location / {
# root /usr/share;
# index index.php;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
# try_files $uri $document_root$fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
fastcgi_param HTTP_PROXY "";
fastcgi_param HTTPS on;
fastcgi_request_buffering off;
}
}
即使在localhost:88
上正常工作,并且尝试登录控制台时,我也只是刷新了页面,而没有任何错误或页面更改。
我想念什么?
答案 0 :(得分:0)
我不知道为什么,但是删除HTTPS部分使它起作用。现在我的配置文件如下:
server {
server_name _;
listen 88;
listen [::]:88;
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
allow all;
# access_log logs/host.access.log;
# error_log logs/host.error.log;
root /usr/share/phpmyadmin;
index index.php;
location / {
# root /usr/share;
# index index.php;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
# try_files $uri $document_root$fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
# fastcgi_param HTTP_PROXY "";
# fastcgi_param HTTPS on;
# fastcgi_request_buffering off;
}
}
如果有人知道为什么现在可以使用,我很好奇