标签:text nginx tle oct virtual head pre str class
index.html
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>index</title> 6 </head> 7 <body> 8 <!--#include virtual="common/header.html"--> 9 </body> 10 </html>
header.html
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>header</title> 6 </head> 7 <body> 8 hello world! 9 </body> 10 </html>
修改D:\nginx\conf\nginx.conf,在service中增加下面配置。
ssi on; ssi_silent_errors on; ssi_types text/shtml;
注:如果要在html静态页面中使用include,则需要借助nginx服务且需要开启ssi 服务才能生效!!
标签:text nginx tle oct virtual head pre str class
原文地址:https://www.cnblogs.com/chenghu/p/14962998.html