[6.x] Fix StaticWarm to work being reverse proxy & add base_uri option#13146
[6.x] Fix StaticWarm to work being reverse proxy & add base_uri option#13146CapitaineToinon wants to merge 1 commit intostatamic:6.xfrom
Conversation
|
I wanted to add a unit test but turns out the test |
|
So the problem is that Guzzle Client is never injected anywhere by laravel but instead created using the new keyword. However, the By the way, when using a Guzzle Pool, the pool will call I tried fixing this but since it seems like the code is using Guzzle Requests all over the place, I can't simple replace Guzzle by Laravel's Http Client. I think we would need a Client factory and then that factory could be mocked instead. Let me know how you prefer to handle this. |
As stated in #13145, this PR fixes the StaticWarm command to work behind a reverse proxy by setting the Guzzle client to hit
config('app.url')by default. This means that if laravel isn't exposed to the internet but instead is reverse proxied by nginx that passes back the requests to php-fpm, this will use theconfig('app.url')to hit nginx instead oflocalhostas it does currently.This PR also adds a simple
base_urioption to the command to override thatbase_uri. This can be useful if you wish laravel hits the other nginx docker service, for example by setting--base_uri=http://nginxfor example.Fixes #13145