當我 ping 我的 localhost 或 ip 127.0.0.1 時,它會回傳 nginx 登錄頁面 html。但是從我的公共 IP 我無法訪問它。我重新安裝了nginx。但是問題沒有解決
ubuntu@ip-my-ip:~$ curl 127.0.0.1
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>```
uj5u.com熱心網友回復:
檢查您的 Ec2 實體所屬的安全組的入站規則。
默認情況下,在啟動 Ec2 實體時,允許來自任何地方的入站 SSH 流量,但不允許 HTTP 和 HTTPS:

午餐后編輯配置實體:
在 AWS EC2 -> 轉到 Instance 并找到您的實體安全組名稱。
AWS EC2 中的 Sill -> 滾動左側面板,直到“網路和安全”中的安全組 -> 找到您的 EC2 實體所屬的安全組并編輯入站規則以允許 HTTP(埠 80)和 HTTPS(埠 443)來自您的 IP 或任何 IP。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/492388.html
標籤:亚马逊网络服务 nginx 亚马逊-ec2 nginx 配置
上一篇:如何使用安全WebSockets(wss)在Azure應用服務的Docker容器中設定nginx?
下一篇:NGINX Phusion乘客server_tokens:關閉;和proxy_hide_headerX-Powered-By;似乎不起作用
