架构总览
环境准备与单节点部署要点
server {
listen 80;
server_name your_domain.com;
root /path/to/yourphp/public; # 建议指向 public
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
}
以上为在 CentOS 上部署 ThinkPHP 的通用做法,可作为高可用架构的单节点基线。高可用实现步骤
健康检查与运维要点
快速验证清单