# 示例:slake.ali251.langye.net 完整 Nginx 站点配置 # 复制后修改 root、fastcgi_pass、证书路径,放入 /etc/nginx/sites-available/ 并软链到 sites-enabled server { listen 80; server_name slake.ali251.langye.net; # 修改为服务器上 Laravel public 目录的绝对路径 root /var/www/slake-school-service/public; index index.php index.html; charset utf-8; client_max_body_size 64m; # ── 管理后台 SPA(Hash 路由)──────────────────────── include /var/www/slake-school-service/deploy/nginx-admin-spa.conf; # ── Laravel 主站 ─────────────────────────────────── location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; # 按实际 PHP 版本修改 fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; fastcgi_hide_header X-Powered-By; } location ~ /\.(?!well-known).* { deny all; } }