現(xiàn)在我們的nginx支持泛域名的響應(yīng),*.domain.com,我們對(duì)泛域名下的子站做了首頁(yè)靜態(tài)化:
比如:sc.domain.com
靜態(tài)化的首頁(yè)文件是sc_index.html
nginx能否配置實(shí)現(xiàn)請(qǐng)求sc.domain.com/index.html
的時(shí)候,響應(yīng)拋出sc_index.html
最近剛弄了下這個(gè)配置,直接加上下面配置即可:
location =/ {
rewrite (.*) /static_index.html last;
}