首頁  >  問答  >  主體

nginx 怎麼根據不同子網域對應不同目錄的資源檔 ?

例如:a.example.com/index.html 對應/a-direcoty/index.html,而b.example.com/index.html 對應/b-direcoty/index.html

#
黄舟黄舟2714 天前661

全部回覆(2)我來回復

  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:14:52

    雷雷

    回覆
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:14:52

    nginx設定檔可以設定server段,在server中設定server_name來指定網域名稱。所以你這種情況就設定兩個server,分別是兩個域名,然後再設定root為具體目錄

    回覆
    0
  • 取消回覆