nginx windows:網站只能透過本地主機訪問,而使用 IP 位址時則無法訪問

nginx windows:網站只能透過本地主機訪問,而使用 IP 位址時則無法訪問

我正在我的 Windows 機器上執行 nginx(v.1.20.1)代理程式。以下是nginx.conf

http {
  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;
  keepalive_timeout  65;

  server {
      listen       *:80;
      server_name  localhost;

    
      location / {
          proxy_pass http://localhost:9000;
      }

      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  }
}

當我localhost在瀏覽器中輸入時,我得到了正確的回應。

但是當我使用我的 IP 位址時,它說無法訪問該網站。

我嘗試過允許連接埠 80 上的外部存取以及nginx.exeWindows Defender 防火牆中的存取。我還停用了卡巴斯基安全軟體中的防火牆。

有什麼想法嗎?

答案1

您需要啟用 ip 存取控制才能存取它。

檢查此連結以了解更多步驟:關聯和這個關聯

相關內容