deploy(M00-E): 补充API域名HTTPS检查
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$Domain = "api.txyundm.cn"
|
||||
$Origin = "https://$Domain"
|
||||
$Paths = @(
|
||||
"/health",
|
||||
"/app-api/health",
|
||||
"/admin-api/health"
|
||||
)
|
||||
|
||||
Write-Host "INFO: checking DNS for $Domain"
|
||||
try {
|
||||
Resolve-DnsName -Name $Domain -ErrorAction Stop | Select-Object -First 3 | Format-Table -AutoSize
|
||||
} catch {
|
||||
Write-Warning "DNS check failed from Windows: $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
foreach ($Path in $Paths) {
|
||||
$Url = "$Origin$Path"
|
||||
Write-Host "INFO: probing $Url"
|
||||
try {
|
||||
$Response = Invoke-WebRequest -Uri $Url -Method Head -TimeoutSec 10 -ErrorAction Stop
|
||||
Write-Host "PASS: $Url -> $($Response.StatusCode)"
|
||||
} catch {
|
||||
Write-Warning "HTTPS probe failed for ${Url}: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user