php - Nginx 正在运行,但页面为空白
问题描述
我正在尝试在 DigitalOcean 中托管的 Ubuntu 服务器上配置 MunkiReport ( https://github.com/munkireport/munkireport-php ) 站点。我已经安装和配置了 PHP 和 MySQL。当我导航到我的 webroot 时,我从 nginx 收到一条成功的消息。
我的 webroot 是/usr/share/nginx/html
,我将/usr/local
其用作 Munki 和 MunkiReport 的存储库。/usr/local/report/public
我将文件夹的符号链接放入/usr/share/nginx/html
.
这是我的 nginx 配置(/etc/nginx/sites-enabled/default
)文件:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name example.com;
location /report {
alias /usr/share/nginx/html/public;
autoindex off;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
location /munki_repo/ {
alias /usr/local/munki_repo/;
autoindex off;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
if ($host = example.com) {
return 301 https://$host$request_uri;
}
}
我的.env
MunkiReport 文件夹的根目录中有一个文件,其中包含配置信息(MySQL 数据库连接)。
当我导航到该https://example.com/report
位置时,没有加载任何内容。控制台也没有显示任何错误,它只是空白。
解决方案
推荐阅读
- azure - Azure 前端 Web APP 和 Azure APIM 相互客户端证书身份验证不起作用
- java - spring-data-hazelcast @Query 注释给出 NullPointerException
- swift - 期望 SwiftUI DynamicProperty 属性包装器的内部更新来触发视图更新是否正确?
- javascript - 谷歌脚本:变量总是显示未定义
- c - 如何在c中正确扫描txt文件中的东西
- vue.js - 构建 Vue 微前端应用(带有路由和 vuex 商店)
- angular - 找不到“路径”模块中的错误:错误:无法解析 - Angular 6 Webpack
- php - Facebook - 消息传递 webhook 不断循环回调 php 文件
- r - 使用 R 和 rvest 进行网页抓取
- docker - 如何从 docker 容器内的应用程序发布 Web 服务?