Laravel Homestead虚拟主机配置 [英] Laravel Homestead vhost configuration

查看:132
本文介绍了Laravel Homestead虚拟主机配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel宅基地.对于项目,我需要特殊的虚拟主机配置,该在哪里定义?

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

推荐答案

您将新的文件夹映射添加到Homestead.yml的"sites"块中,如下所示:

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

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

这就是添加新的虚拟主机的全部.要对其进行修改,请在/etc/nginx/sites-available中编辑相应的文件.在上述情况下,该值为/etc/nginx/sites-available/myapp.com

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

有关自定义新添加的虚拟主机的示例,请参见此处.请注意,此处链接的快速技巧使用Homestead Improvement,它是Homestead的稍微增强的版本,如这里.

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.

可通过 Homestead标签在我们的网站上找到更多与Homestead相关的帖子.

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

这篇关于Laravel Homestead虚拟主机配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆