ssi技术

时间:2023-03-09 02:00:39
ssi技术

html页面

<!DOCTYPE html>
<html>
<head>
<title>测试ssi</title>
<meta name="generator" content="Bluefish 2.2.4" >
<meta name="author" content="shenxi" >
<meta name="date" content="2014-04-25T10:13:12+0800" >
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="">
<meta >
</head>
<body>
<h1>测试ssi</h1>
<h3>头部</h3>
<!--#include file="/test/header.html"-->
<h3>页体</h3>
<!--#include file="/test/ssi.php"-->
<h3>尾部</h3>
<!--#include file="/test/footer.html"-->
</body>
</html>

在php_app.conf文件中添加

rewrite_log on;

location / {
# try_files $uri $uri/ /missing.html;
# ssi on;
# ssi_silent_errors on;
}
location = /data/ {
return ;
} location ~ "^/cgi/" {
return ;
}
# location = /missing.html {
# root /data/webroot/pre_file;
# }
# error_page /missing.html; location ~ \.php$ {
if ($uri !~* "^/data/"){
fastcgi_pass 127.0.0.1:;
}
include fastcgi.conf;
ssi on;
ssi_silent_errors on;
}