laravel / sail

Docker files for running a basic Laravel application.
https://laravel.com/docs/sail
MIT License
1.65k stars 470 forks source link

Sail share does not work for linux hosts #708

Closed rqpt closed 1 month ago

rqpt commented 1 month ago

Sail share responds with a 504 timeout. Setting trustedProxies to '*' in middleware does not fix this.

A user already solved the issue, and it seems to work perfectly. I am not able to test if this breaks sail for windows or apple hosts, unfortunately. Please see the thread below.

This is still broken for me after removing/reinstalling the image as recommended. I can get to the expose dashboard where you can follow the requests, but trying to use the expose url without the port gives me a 404, and the url with the port just spins forever and never does anything.

This issue exists only on linux hosts. I submitted a pull request to beyondcode/expose repository which fixes the issue. Link to PR: beyondcode/expose#293

Just to expand on this, as it's still an issue in sail, for Linux users.

  1. Find and open your sail file (spoiler, it's just a bash script): /laravel_app/vendor/laravel/sail/bin/sail
  2. For me it's on line 470, but just search for beyondcodegmbh/expose-server
  3. Then add in --add-host=host.docker.internal:host-gateway into the docker run command. I put it in between --rm and -p
  4. Save, and re-run sail share

And it should now work.

Originally posted by @adriel in https://github.com/laravel/sail/issues/74#issuecomment-1306756663

driesvints commented 1 month ago

Please don't ignore the issue template when posting bug reports.