GCEにnginxをインストールしたが、接続できなかったので調査したときの話です。
以下のエラーがでた
curl: (7) Failed connect to ...:**; 接続を拒否されました
・ping確認
PING ...:** (...:) 56(84) bytes of data.
64 bytes from ***...:: icmp_seq=1 ttl=55 time=127 ms
--- *...: ping statistics ---
14 packets transmitted, 14 received, 0% packet loss, time 13017ms
https://eng-entrance.com/linux-command-ping
上記のサイトにあるとおり、正常に疎通はとれてる
apacheを入れなおして、apacheを起動したら正常にアクセスできた。
curl -I ...
HTTP/1.1 403 Forbidden
Date: Tue, 24 Mar 2020 22:39:08 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
ETag: "1321-5058a1e728280"
Accept-Ranges: bytes
Content-Length: 4897
Content-Type: text/html; charset=UTF-8
Curlの表示も変わった。
nginxが起動できてなかったという恥ずかしい話でした。
【思ったこと】
・GCPのファイアウォールの設定を理解は必要
https://dev.classmethod.jp/articles/gce-firewall/
【参考サイト】
http://yebisupress.dac.co.jp/2018/08/23/publish_website_with_google-cloud-platform/