
Luis Santiago Cortés Hernández
PreguntaCuando ejecuto el siguiente comando “curl -I localhost” me muestra el siguiente error HTTP/1.1 502 bad gateway

Julio Enrique Andrade Vidarte
Al introducir ese comando, me muestra información sobre el servidor web que tengo instalado en el puerto 80.
<code> user@ubuntu-server:~$ curl -I localhost HTTP/1.1 200 OK Date: Tue, 15 Sep 2020 22:10:40 GMT Server: Apache/2.4.41 (Ubuntu) Last-Modified: Tue, 26 May 2020 22:03:53 GMT ETag: "2aa6-5a694456aeb18" Accept-Ranges: bytes Content-Length: 10918 Vary: Accept-Encoding Content-Type: text/html
A mi entender, el mensaje de error que te sale se debe a que tiene problemas con la puerta de enlace predeterminada configurada en tu servidor. Por tanto, es probable que no tengas conexión a internet desde tu máquina virtual. Otra causa del problema podría ser que haya algún problema con la configuración de tu servidor web.

Iván Araolaza
Yo estoy usando una Raspberry Pi 4B en lugar de una máquina virtual. A mi me ocurrió este error porque en
/etc/nginx/sites-available/default
proxy_pass https://localhost:8080/;
En lugar de:
proxy_pass http://localhost:8080/;
Al modificar eso, reiniciar el servicio y checkear el status,
curl -I localhost
HTTP/1.1 200 OK Server: nginx/1.18.0 (Ubuntu) Date: Mon, 31 Jan 2022 16:42:09 GMT Content-Type: text/html Content-Length: 10918 Connection: keep-alive Last-Modified: Sun, 30 Jan 2022 21:18:39 GMT Accept-Ranges: bytes Vary: Accept-Encoding