-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valet secure && valet share not working properly #148
Comments
When you run
...which is accessible from anywhere. |
Yes, and the generation of the url is working properly, but when I access this url from my iphone then I am redirected to my https://shop.app that is my url in my mac computer, but my iPhone don't know where is https://shop.app, so I never see my lumen environment from my phone. |
Ah you are using |
Man, you are amazing. |
Yeah we will need to figure out a way to support it, currently |
Are there something that I can do for help solve it? |
Sure! It seems like the change would need to happen somewhere in here: https://github.com/laravel/valet/blob/master/valet#L35-L55 Would need to determine if the site has local https enabled, and figure out what the correct options to pass to ngrok should be to forward to the https version of the site. I don't personally have any experience using ngrok and haven't worked on this part of the codebase before so that's the all of the information I have 😊 |
Thanks for your tip, I will try figure out in this weekend and do a PR. |
@RafaelPlantard ... Just chiming in to say I ran into this same situation, and due to a time crunch didn't get around to looking at how to fix it. I look forward to what you come up with! |
Guys (@drbyte, @adamwathan) trying doing the solution I realize two things: The TLS tunnels are only for PRO:
The TLS tunnels are not a suitable solution for this case:
So my solution consists in check if the current link to share is secured over TLS or not. Can see the PR? |
I found that valet creates separate Nginx configuration file for each .dev domain only when you decide to use Valet secure No more, too many redirect after doing that and it works fine. don't forget to do Valet restart after removing port 80 configuration section. |
Are you a monster @hasusuf ???? I will try it today. |
Excuse me @RafaelPlantard, I didn't notice that! 😄 |
@hasusuf But this is a awesome point to the @adamwathan @drbyte |
Anyone know how can I install php71-memcached with Homebrew??? |
That's kinda off-topic for Valet. But if you're building a new Laravel app, I'd recommend using Redis instead of memcached. (Admittedly it's an age-old war about which one is best). But if you must install it, run |
The question is that I will need a php71 driver to memcached that apparently not exists to php71. But, thanks for your considerations, actually I'm working with PHP but in my own projects I'm using vapor (swift server side). |
Did you read this comment #148 (comment)? |
I was trying to use php71 + valet, but I was getting |
I'm using PHP 7.1 with Valet 2.03. No issues with Bad Gateway in normal use. I ran into similar issue as @hasusuf with ngrok for a site that I had previously run |
@hasusuf Can you send a example of the change required at nginx conf file? |
Same issue as @RafaelPlantard. I had to downgrade! Did you finally solved??? |
I uninstall completely all php70 from homebrew and install all php71 packages that I use (memcached, mongodb), before it, I stop and install a newer version of valet. And for my surprise it worked. |
So the way I've got valet secure to work with valet share is by configuring valet's installed ngrok instance to use my ngrok auth token. You don't need a paid account with ngrok, you just need a free registered account. To then pass that Authtoken to the instance of ngrok installed by valet you can then do: Workaround courtesy of https://joelennon.com/using-reserved-ngrok-subdomains-in-laravel-valet |
Did people eventually get this to work? The issue for us (and I believe for others) is that if you're running local https you need ngrox to map to port 80 for http and port 443 for https. Currently, when I run share I see both http and https pointing to port 80. |
Closing as it seems the core issue is resolved-ish. @onlinelaser If that is a consistently predictable solution, it may (no guarantees!) be an interesting PR to the docs. @mcblum If this is something you're actively pursuing and none of the discussions above help, could you open a new issue? This thread is a bit of a monster at the moment. Thanks! |
@mattstauffer no worries dude - got it sorted. Basically, as stated above, you just have to modify the valet Nginx config to also serve the site on port 80. Its default behavior is to force a 301 on port 80 which breaks ngrok. |
@mattstauffer please how did you modify Nginx config, I can't seem to find anything related to port |
This makes it possible to still access the site via http if it is secure This touches laravel#382, laravel#148, laravel#156, laravel#504
For @ogoom and anyone else who ended up here. To allow valet to serve the secure ngrok url over port 80 open the site's config which can be found at i.e. Change:
To:
|
I have a proposal: So the ngrok fix is now: That probably fixes it and gets around the pro ngrok issue as we will be serving an usual http:// site, only not on the std issue port. |
Made a implementation of that idea, submitted as a PR: #630 |
I am trying to access the generated url by valet share on my iPhone but is not working.
Apparently it is only redirect to my valet local address, but that url is not available on the web, how can I fix it?
The text was updated successfully, but these errors were encountered: