You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# 示例: 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;
}
}