Laravel Homestead: 403 forbidden on nginx

后端 未结 16 2423
醉话见心
醉话见心 2020-12-30 19:17

I just installed Laravel Homestead according to their instructions. When I open http://homestead.app:8000 I get the nginx 403 forbidden HTTP Response.

I have tried s

16条回答
  •  滥情空心
    2020-12-30 19:33

    In your case, you are getting nginx 403 forbidden HTTP Response because of improper configuration of sites in Homestead.yaml, if you configure it properly it should work.

    How to solve the issue step by step:

    1) Goto your vagrant box and create the laraval app

    $vagrant ssh
    $cd ~/code
    
    $#lets create basic blog 
    $laravel new blog
        Crafting application...
        Loading composer repositories with package information
        ........
    
    $cd blog
    $ll
       # You should be able to see public folder in this dir.
       # this is the entry point for your application.
       # this is your public dir: ~/code/blog/public
       # more explicitly: /home/vagrant/code/blog/public
    
    $exit   # exit ssh
    

    2) Update the Homestead.yaml with proper site info

     - map: homestead.app
       to: /home/vagrant/code/blog/public  # should be same as in step1
    

    3) Re-provision your vagrant

    $vagrant reload --provision
    

    You should be able to access it now using http://homestead.app Thank you!

提交回复
热议问题