Laravel Homestead vhost configuration

前端 未结 2 1504
再見小時候
再見小時候 2021-01-12 14:19

I am using Laravel homestead. For a project I need a special vhost configuration, where should I define this?

2条回答
  •  北海茫月
    2021-01-12 14:53

    You add a new folder mapping into the "sites" block of Homestead.yml, like so:

    - map: myapp.com
      to: /home/vagrant/Code/myapp/public
    

    That's all there is to adding a new vhost. To modify it, edit the appropriate file in /etc/nginx/sites-available. In the above case, this would be /etc/nginx/sites-available/myapp.com

    See here for example customization of a newly added vhost. Note that the quick tip linked here uses Homestead Improved, a slightly enhanced version of Homestead, as described here.

    More Homestead related posts can be found on our site via the Homestead tag.

提交回复
热议问题