46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
# ==============================================================================
|
|
# ARQUIVO TEMPORÁRIO: Teste de Conectividade
|
|
# REMOVER APÓS VALIDAÇÃO DA TAREFA 4
|
|
# ==============================================================================
|
|
|
|
server {
|
|
listen 8080;
|
|
server_name localhost test-connectivity;
|
|
|
|
# Health check simples
|
|
location /health {
|
|
return 200 "OK - nginx-proxy respondendo\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
|
|
# Teste 1: Ping para 10.10.253.254
|
|
location /test/254 {
|
|
proxy_pass http://10.10.253.254/;
|
|
proxy_connect_timeout 5s;
|
|
proxy_read_timeout 10s;
|
|
error_page 502 504 = @test_failed;
|
|
}
|
|
|
|
# Teste 2: Ping para 10.10.253.128 (Gitea - porta 3000)
|
|
location /test/128 {
|
|
proxy_pass http://10.10.253.128:3000/;
|
|
proxy_connect_timeout 5s;
|
|
proxy_read_timeout 10s;
|
|
error_page 502 504 = @test_failed;
|
|
}
|
|
|
|
# Teste 3: Acesso via host.docker.internal (rede do host)
|
|
location /test/host {
|
|
# Tenta acessar a porta 80 do próprio host
|
|
proxy_pass http://host.docker.internal/;
|
|
proxy_connect_timeout 5s;
|
|
error_page 502 504 = @test_failed;
|
|
}
|
|
|
|
# Fallback para testes que falharam
|
|
location @test_failed {
|
|
return 503 "FALHA: Não foi possível conectar ao backend\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
}
|