Vagrant port forwarding 80 to 8000 with Laravel Homestead

前端 未结 3 1116
我寻月下人不归
我寻月下人不归 2021-01-07 00:25

My Problem:

I can only access my sites through port 8000, but not 80, which makes me think it is not redirecting 80 to 8000 as it says it should be.

3条回答
  •  我在风中等你
    2021-01-07 00:38

    I see there is an accepted answer, but this alternative may also help someone. If I understand correctly you really dislike the port "8000"!

    Have you tried setting a private network?

    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
        /*other config stuff here */
        config.vm.network :private_network, ip: "192.168.33.22"
    

    This way you can simply use that IP address, or edit you hosts file to map the local domain to that IP.

    Take a look at the Vagrant docs:Vagrant Private Networks

    BTW, You shouldn't need to shutdown your IIS local server as that is running on a totally different IP range. I have Apache running locally while also accessing the VM server. This allows you to use tools like composer (to pull in laravel) on your local if needed.

提交回复
热议问题