Laravel Homestead: 403 forbidden on nginx

后端 未结 16 2224
醉话见心
醉话见心 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:46

    Here's the full solution steps:

    1. run homestead edit

    2. add /public to the end of your directory

    sites: - map: homestead.app to: /full/path/to/the/laravel-app/public

    1. run homestead halt && homestead up --provision
    0 讨论(0)
  • 2020-12-30 19:49

    For some people this may be as simple as having git cloned in an existing public folder, e.g:

    - map: hello-world.dev
      to: /home/vagrant/Code/Laravel/public/hello-world
    

    The correct folder structure is:

    - map: hello-world.dev
      to: /home/vagrant/Code/hello-world/public
    

    Another good note is ignoring the laravel docs on editing hosts file, using git shell, or cygwin (windows) to install vagrant hostsupdater, and simply adding entries for hosts and aliases to ~/.homestead/Homestead.yaml file.

    0 讨论(0)
  • 2020-12-30 19:51

    Configuring Nginx Sites :

    sites: - map: homestead.test to: /home/vagrant/project1/public

    0 讨论(0)
  • 2020-12-30 19:51

    To fix, ssh into your homestead, then do : nano /etc/nginx/sites-available/the-name-of-your-project.test

    After that all you need to do is get rid of $uri/ that you will find in the location object , then do vagrant reload and error should be fixed.

    0 讨论(0)
提交回复
热议问题