我设置了一个 nginx Web 服务器来运行我正在开发的两个站点,它们基本上是相同的站点,具有相同的配置,基于 Laravel 框架构建。两者都有登录设置,但每次我尝试登录时,其中一个都会给出 502 错误。每当我尝试登录时,都会收到 502 错误,如果我检查 nginx 错误日志,我会看到以下内容:
2020/10/21 22:26:59 [错误] 10400#10400: *12 上游在从上游读取响应标头时发送了太大的标头,客户端:162.158.179.216,服务器:vms2.medlab.co,请求:“POST /登录 HTTP/1.1”,上游:“fastcgi://unix:/run/php/php7.4-fpm.sock:”,主机:“vms2.medlab.co”,引荐来源:“https://vms2.medlab .co/”
我的网站的conf文件如下,与我的其他网站完全相同,运行得很好:
#http
server {
listen 80;
server_name vms2.medlab.co;
root /var/www/vms.medlab.co/current/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
# …Run Code Online (Sandbox Code Playgroud)