网站运行目录还没指向 public,跟着下面三步即可正常访问
按下面路径操作一次即可(无需重启,即时生效):
如果同一页面里“网站类型”显示为纯静态,请一并改为 PHP-8.2 或以上版本,否则 PHP 无法运行。
不配置这一步网站也能打开,但文章页、播放页等美化链接会 404。复制下面这段即可,已与项目配置文件保持一致。
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ^~ /theme/ {
try_files $uri /index.php?$query_string;
access_log off;
}
location ~ /\.(env|git|htaccess|htpasswd) {
deny all;
}
location ~ ^/(app|database|runtime|bin|themes|docs)/ {
deny all;
}
location ~* ^/uploads/.*\.(php|phar|phtml)$ {
deny all;
}
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options SAMEORIGIN always;
add_header Referrer-Policy no-referrer always;
location ~* \.(css|js|png|jpg|jpeg|gif|webp|svg|ico|woff2?)$ {
try_files $uri /index.php?$query_string;
expires 7d;
add_header Cache-Control "public";
access_log off;
}
完成第一步后,点此直接开始初始化数据库与管理员账号。
进入安装向导目标地址:/channel/install/