02 nginx in ssi technology

SSI: Server Side Include, is a web-based server production technology, most (particularly those based on Unix platforms) web server such as Netscape Enterprise Server Dengjun support SSI command. It provides added include static pages contain functional.

1, the premise of restraint

  • Familiar with nginx
    https://www.jianshu.com/p/c8aa1a323e3a
    author of nginx extract the directory is D: \ Program Files \ nginx- 1.14.0

    2, Procedure

  • Create a folder in ssitest no space, no Chinese path, this example is created in the desktop
  • Create a folder index.html in ssitest
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
</head>
<body>
    <!--#include virtual="head.html"-->
    this is body
</body>
  • Create a folder head.html in ssitest
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
</head>
<body>
    this is head
</body>
  • Modify D: \ Program Files \ nginx-1.14.0 \ conf \ nginx.conf
ssi on;
ssi_silent_errors on;
location /ssitest {
    alias "C:/Users/zhangli/Desktop/nginxssi/";
}
  • Start or restart nginx
cd D:\Program Files\nginx-1.14.0
# 启动nginx
nginx.exe
# 或者重启nginx
nginx.exe -s reload
  • Test
    visit http: //localhost/ssitest/index.html, we can see the head and the index result of the merger.
    These are the use of nginx ssi features include complete static pages.

Guess you like

Origin www.cnblogs.com/alichengxuyuan/p/12504347.html
ssi