Homestead-通过http:// localhost:PORT访问

问题描述 投票:1回答:1

没有人知道是否有办法将http://localhost:PORT解析为在宅基地上运行的项目。因此传统上,您可以按照以下步骤在hostHomestead.yaml上设置所需的地址。

主机

192.168.10.10 first.test
192.168.10.10 second.test

Homestead.yaml

ip: "192.168.10.10"
folders:
    ## first config
    - map: C:\Users\first
      to: /home/vagrant/first
    ## first config
    - map: C:\Users\second
      to: /home/vagrant/second
sites:
    ## first config
    - map: first.test
      to: /home/vagrant/first/public
      php: "7.1"    
    ## second config
    - map: second.test
      to: /home/vagrant/second/public
      php: "7.1"    

但是当我想使用localhost:8082localhost:8083而不是first.testsecond.test时,它不起作用。

side note:之所以要使用localhost是因为我有多个项目,并且正在使用laravel webpush,除非您使用localhost,否则Service Workers需要HTTPS。

谢谢

laravel vagrant homestead
1个回答
0
投票

对于其他可能想知道的人,尝试localhost:PORT方法时多次失败。我决定采用不同的方法,而是在宅基地上启用https。只需跟随Homestead SSL on WindowsHomestead SSL on Mac

© www.soinside.com 2019 - 2024. All rights reserved.