Laravel Homestead和Nginx子域通配符

时间:2016-01-09 17:38:24

标签: php ubuntu nginx dns homestead

我有nginx和宅基地的问题。我无法使动态子域工作。我试过这里的一切都是我的配置。

OS:Ubuntu 14.04 LTS 64bit

客户操作系统:Ubuntu 14.04 LTS 32位(与Homestead一起流浪)

Homestead.yaml

ip: "192.168.10.10"
memory: 512
cpus: 1
provider: virtualbox

authorize: /home/user/.ssh/id_rsa.pub

keys:
    - /home/user/.ssh/id_rsa

folders:
    - map: /home/user/Projects
      to: /home/vagrant/Projects

sites:
    - map: businesspage.local
      to: /home/vagrant/Projects/BusinessPage/public

的/ etc /主机

192.168.10.10   businesspage.local
192.168.10.10   *.businesspage.local

/etc/nginx/sites-enabled/businesspage.local

server {
    listen 80 default_server;
    listen 443 ssl;
    server_name businesspage.local *.businesspage.local;
    root "/home/vagrant/Projects/BusinessPage/public";

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

最后这是我在dnsmasq.conf中添加的内容

address=/.local/192.168.10.10

我还在主机网络配置中添加了192.168.10.10作为附加DNS服务器。我也闪过dns,重新启动等......我不知道还能做些什么。当我尝试打开http://businesspage.local时,它可以正常工作,但如果我尝试打开http://en.businesspage.local它就无法正常工作。任何帮助将非常感激。提前致谢

更新:对于遇到相同问题的人,请勿使用.local TLD。这是我的问题。 .local是由samba或其他东西使用的......你应该使用.dev或其他东西,但不能使用.local !!!

0 个答案:

没有答案
相关问题