解決 laradock 中 Guzzle/Curl 出現 error [curl] 7

導語

今天在使用 Guzzle 的時候,出現了 [curl] 7: Failed to connect to xxx port 80: Connection refused 這個問題。沒有查到相關的中文資料,最終踩了一些坑後解決。簡而言之就是修改 docker-compose.yml 中關於 nginx 的配置,然後重新安裝就可以了。

修改配置

NGINX Server 修改如下

networks:
 frontend:
  aliases:
   - you_site
 backend:
  aliases:
   - you_site

重裝 nginx

  1. 切換到 laradock
  2. docker-compose stop nginx
  3. docker-compose build --no-cache nginx
  4. docker-compose up -d nginx

參考資料:GitHub issues

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章