Nginx下html中启用include引入html功能

Nginx下html中启用include引入html功能

  1. Nginx中启用ssi,location配置中加入三行配置,重启。

    location / {
    ssi on;
    ssi_silent_errors on;
    ssi_types text/shtml;
  2. index.html引入header.html

    <!-- 切记include的#前不能有空格 -->
    <!--#include file="/html/public/header.html"-->

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注