mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-11 12:10:45 +08:00
fix: 解决网站某些设置会报服务器内部错误的问题 (#2973)
Refs https://github.com/1Panel-dev/1Panel/issues/2955
This commit is contained in:
parent
49d8582658
commit
88c3559245
1 changed files with 5 additions and 2 deletions
|
|
@ -196,9 +196,12 @@ func opNginx(containerName, operate string) error {
|
||||||
if operate == constant.NginxCheck {
|
if operate == constant.NginxCheck {
|
||||||
nginxCmd = fmt.Sprintf("docker exec -i %s %s", containerName, "nginx -t")
|
nginxCmd = fmt.Sprintf("docker exec -i %s %s", containerName, "nginx -t")
|
||||||
}
|
}
|
||||||
if out, err := cmd.ExecWithTimeOut(nginxCmd, 2*time.Second); err != nil {
|
if out, err := cmd.ExecWithTimeOut(nginxCmd, 20*time.Second); err != nil {
|
||||||
|
if out != "" {
|
||||||
return errors.New(out)
|
return errors.New(out)
|
||||||
}
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue