我正在尝试在我的 Pi 上安装 phpBB。这是安装的基本站点:
192.168.178.62/phpBB3/install/app.php
这是它尝试访问的 URL:
http://192.168.178.62/phpBB3/install/app.php/install
返回 404。所有内部链接都会发生这种情况,例如支持或许可。我的 nginx 配置:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html info.php;
server_name 192.168.178.62;
error_page 404 /404.html;
location / {
try_files $uri $uri/ =404;
}
location /pad/ {
proxy_pass http://192.168.178.62:9001/;
}
location /chat {
proxy_pass http://192.168.178.62:3002/;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
文件 fastcgi-php.conf 位于 /etc/nginx/snippets 中,其内容如下:# regex to split $uri to $fastcgi_script_name 和 $fastcgi_path fastcgi_split_path_info ^(.+?.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;