Server Side Include: Servers-side embedding
Rationale: Before sending content to a browser, you can use the server side include (SSI) directive to include text, graphics, or application information in a Web page. Because files containing SSI directives require special processing, SSI file extensions must be assigned to all SSI files. The default extension is. stm,. shtm, and. shtml
Mainly for the following purposes: 1, display server-side environment variables < #echo >2, insert text content directly into the document < #include >3, display information about the Web document < #flastmod #fsize > (such as file date/size, etc.) 4, direct execution of various programs on the server < #exec > (such as CGI or other executable program) 5, set the SSI information display format < #config >; (such as file date/size display method) Advanced ssi< xssi>; can set variables using the IF condition statement. Nginx Open SSI Edit nginx configuration file vi/usr/local/nginx/conf/nginx.conf Add the following code SSI on;ssi_silent_errors on;ssi_types text/shtml; save Restart Nginx I configuration case
Location ~ \.shtml$ { SSI on; Ssi_silent_errors on; Ssi_types text/shtml; }
Where SSI is applied is the separation of static fragments from the respective gaming websites, which are introduced in SSI's way
<!-- #include file= "head.shtml" -
Among the setbacks encountered were
The path name of file is written as an access address such as <!--#include file= "http://hejungw.feiliu.com/site/gc/wap/list/head.shtml"--that's not right.
And then write the server-side absolute address such as <!--#include file= "/data0/www/html/hejungw/static/ssi/13/head.shtml"--that's not right.
Finally, the relative address is written correctly.
Include another notation
<!-- #include virtual= "/site/gc/wap/list/head.shtml" -
Virtual: gives a path to a document on the server side
The virtual path removes the remaining path to the domain name for the URL that accesses the fragment
The URL to access the head fragment in this project is http://hejungw.feiliu.com/site/gc/wap/list/head.shtml
comprehensive to introduce external files with the include virtual is convenient
SSI Introduction and Nginx Open SSI