简体   繁体   中英

Call a laravel endpoint from same app using Guzzle when using Laravel sail (Docker)

I have a Laravel app running in Docker containers using Laravel Sail. I want to call an endpoint of the same laravel app from the same app.

I am using Guzzle HTTP client for that, but since app is running inside the container ( using Sail ) it is not able to connect to it and make request.

I tried using host.docker.internal as host for my endpoint but this gives me 502 bad gateway.

which host should I use to make requests inside the same container?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM