2017-04-07 55 views
0

我有一個項目在yii2(後端nginx)上工作。該項目有幾個模塊,它可以有條件地稱爲:yii2 + nginx,子域到模塊

  • 第1類(CAT1)
  • 2類(CAT2)

它使請求cat1.coolsite.example時實現的功能要求,它會打開一個可用的模塊coolsite.example/cat1。因此,第二個類別

回答

1

嘗試爲您的模塊添加2個服務器配置,比如這個,並查看nginx error.log,如果它沒有做到這一點。

server { 

    listen 80; 

    server_name cat1.coolsite.example,; 

    location/{ 
      proxy_pass coolsite.example/cat1/$uri; 
    } 
}